use expect_mirror_to_have_error_and_timeago in remote_mirror_spec

This commit is contained in:
Luke Bennett 2018-08-03 13:06:15 +01:00
parent 5f1dfa9a22
commit a1d2227404
No known key found for this signature in database
GPG key ID: A738E9C68D3BF31A

View file

@ -17,9 +17,7 @@ describe 'Project remote mirror', :feature do
visit project_mirror_path(project)
row = first('.js-mirrors-table-body tr')
expect(row).to have_content('Error')
expect(row).to have_content('Never')
expect_mirror_to_have_error_and_timeago('Never')
end
end
@ -29,10 +27,14 @@ describe 'Project remote mirror', :feature do
visit project_mirror_path(project)
row = first('.js-mirrors-table-body tr')
expect(row).to have_content('Error')
expect(row).to have_content('5 minutes ago')
expect_mirror_to_have_error_and_timeago('5 minutes ago')
end
end
def expect_mirror_to_have_error_and_timeago(timeago)
row = first('.js-mirrors-table-body tr')
expect(row).to have_content('Error')
expect(row).to have_content(timeago)
end
end
end