Don't check the database for voters in system tests
As mentioned in commits likea586ba806,a7664ad81,006128da5,b41fbfa52andc480cdd91, accessing the database after starting the browser with the `visit` method sometimes results in database corruption and failing tests on our CI due to the process running the test accessing the database after the process running the browser has started. In these cases, there's no need to check the database; we're already checking the application behavior that shows that the voters have been correctly created.
This commit is contained in:
@@ -18,8 +18,6 @@ module Polls
|
||||
|
||||
first(:button, "Confirm vote").click
|
||||
expect(page).to have_content "Vote introduced!"
|
||||
|
||||
expect(Poll::Voter.count).to eq(1)
|
||||
end
|
||||
|
||||
def confirm_phone(code:)
|
||||
|
||||
@@ -29,9 +29,6 @@ describe "BudgetPolls", :with_frozen_time do
|
||||
expect(page).to have_content "Vote introduced!"
|
||||
end
|
||||
|
||||
expect(Poll::Voter.count).to eq(1)
|
||||
expect(Poll::Voter.first.origin).to eq("booth")
|
||||
|
||||
logout
|
||||
login_as(admin.user)
|
||||
visit admin_poll_recounts_path(poll)
|
||||
|
||||
@@ -87,9 +87,6 @@ describe "Voter" do
|
||||
expect(page).to have_content("Vote introduced!")
|
||||
end
|
||||
|
||||
expect(Poll::Voter.count).to eq(1)
|
||||
expect(Poll::Voter.first.origin).to eq("booth")
|
||||
|
||||
logout
|
||||
login_as(admin.user)
|
||||
visit admin_poll_recounts_path(poll)
|
||||
@@ -145,7 +142,6 @@ describe "Voter" do
|
||||
scenario "Trying to vote in web and then in booth" do
|
||||
login_as user
|
||||
vote_for_poll_via_web(poll, question, "Yes")
|
||||
expect(Poll::Voter.count).to eq(1)
|
||||
|
||||
logout
|
||||
login_through_form_as_officer(officer)
|
||||
@@ -172,7 +168,6 @@ describe "Voter" do
|
||||
end
|
||||
expect(page).to have_content "You have already participated in a physical booth. " \
|
||||
"You can not participate again."
|
||||
expect(Poll::Voter.count).to eq(1)
|
||||
|
||||
logout
|
||||
login_as(admin.user)
|
||||
@@ -211,7 +206,6 @@ describe "Voter" do
|
||||
|
||||
expect(page).to have_content "You have already participated in a physical booth. " \
|
||||
"You can not participate again."
|
||||
expect(Poll::Voter.count).to eq(1)
|
||||
|
||||
logout
|
||||
login_as(admin.user)
|
||||
|
||||
Reference in New Issue
Block a user