diff --git a/spec/system/budget_polls/voter_spec.rb b/spec/system/budget_polls/voter_spec.rb index 45377cdd3..80a975ad9 100644 --- a/spec/system/budget_polls/voter_spec.rb +++ b/spec/system/budget_polls/voter_spec.rb @@ -32,8 +32,7 @@ describe "BudgetPolls", :with_frozen_time do expect(Poll::Voter.count).to eq(1) expect(Poll::Voter.first.origin).to eq("booth") - visit root_path - click_link "Sign out" + logout login_as(admin.user) visit admin_poll_recounts_path(poll) diff --git a/spec/system/officing/voters_spec.rb b/spec/system/officing/voters_spec.rb index 63143123d..84d0844d1 100644 --- a/spec/system/officing/voters_spec.rb +++ b/spec/system/officing/voters_spec.rb @@ -74,8 +74,7 @@ describe "Voters" do document_number: "12345678Z") expect(user).not_to be_level_two_verified - visit root_path - click_link "Sign out" + logout login_through_form_as_officer(officer.user) visit new_officing_residence_path diff --git a/spec/system/polls/voter_spec.rb b/spec/system/polls/voter_spec.rb index da1a8ff2a..52d2a352a 100644 --- a/spec/system/polls/voter_spec.rb +++ b/spec/system/polls/voter_spec.rb @@ -90,8 +90,7 @@ describe "Voter" do expect(Poll::Voter.count).to eq(1) expect(Poll::Voter.first.origin).to eq("booth") - visit root_path - click_link "Sign out" + logout login_as(admin.user) visit admin_poll_recounts_path(poll) @@ -148,8 +147,7 @@ describe "Voter" do vote_for_poll_via_web(poll, question, "Yes") expect(Poll::Voter.count).to eq(1) - click_link "Sign out" - + logout login_through_form_as_officer(officer.user) visit new_officing_residence_path @@ -165,9 +163,7 @@ describe "Voter" do vote_for_poll_via_booth - visit root_path - click_link "Sign out" - + logout login_as user visit poll_path(poll) @@ -178,8 +174,7 @@ describe "Voter" do "You can not participate again." expect(Poll::Voter.count).to eq(1) - visit root_path - click_link "Sign out" + logout login_as(admin.user) visit admin_poll_recounts_path(poll) @@ -199,9 +194,7 @@ describe "Voter" do login_through_form_as_officer(officer.user) vote_for_poll_via_booth - visit root_path - click_link "Sign out" - + logout login_as user visit account_path click_link "Verify my account" @@ -219,8 +212,7 @@ describe "Voter" do "You can not participate again." expect(Poll::Voter.count).to eq(1) - visit root_path - click_link "Sign out" + logout login_as(admin.user) visit admin_poll_recounts_path(poll)