Check table rows content instead of database
Checking the database with methods like Activity.last does not test that the record is present where it should be (first record of the table in this case). In these tests there's only one record, though, so the order doesn't matter that match. However, calling methods like Activity.last generates a database query after the process running the browser has been started, and this might lead to inconsistent data.
This commit is contained in:
@@ -73,7 +73,7 @@ describe "Officing Results", :with_frozen_time do
|
||||
|
||||
expect(page).to have_content("Your results")
|
||||
|
||||
within("#results_#{poll_officer.officer_assignments.first.booth_assignment_id}_#{Date.current.strftime("%Y%m%d")}") do
|
||||
within "tbody tr" do
|
||||
expect(page).to have_content(I18n.l(Date.current, format: :long))
|
||||
expect(page).to have_content(booth.name)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user