Move set officing booth helper method calls to background block
This commit is contained in:
@@ -16,6 +16,7 @@ feature "Officing Results", :with_frozen_time do
|
||||
create(:poll_question_answer, title: "Tomorrow", question: @question_2)
|
||||
|
||||
login_as(@poll_officer.user)
|
||||
set_officing_booth(@officer_assignment.booth)
|
||||
end
|
||||
|
||||
scenario "Only polls where user is officer for results are accessible" do
|
||||
@@ -32,8 +33,6 @@ feature "Officing Results", :with_frozen_time do
|
||||
|
||||
expect(page).to have_content("Poll officing")
|
||||
|
||||
set_officing_booth(@officer_assignment.booth)
|
||||
|
||||
within("#side_menu") do
|
||||
click_link "Total recounts and results"
|
||||
end
|
||||
|
||||
@@ -12,13 +12,12 @@ feature "Voters" do
|
||||
create(:poll_shift, officer: officer, booth: booth, date: Date.current, task: :vote_collection)
|
||||
booth_assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
|
||||
create(:poll_officer_assignment, officer: officer, booth_assignment: booth_assignment)
|
||||
set_officing_booth(booth)
|
||||
end
|
||||
|
||||
scenario "Can vote", :js do
|
||||
create(:poll_officer_assignment, officer: officer)
|
||||
|
||||
officer_assignment = create(:poll_officer_assignment, officer: officer)
|
||||
set_officing_booth(officer_assignment.booth)
|
||||
visit new_officing_residence_path
|
||||
officing_verify_residence
|
||||
|
||||
@@ -40,11 +39,10 @@ feature "Voters" do
|
||||
scenario "Already voted", :js do
|
||||
poll2 = create(:poll, :current)
|
||||
booth_assignment = create(:poll_booth_assignment, poll: poll2, booth: booth)
|
||||
officer_assignment = create(:poll_officer_assignment, officer: officer, booth_assignment: booth_assignment)
|
||||
create(:poll_officer_assignment, officer: officer, booth_assignment: booth_assignment)
|
||||
|
||||
user = create(:user, :level_two)
|
||||
voter = create(:poll_voter, poll: poll, user: user)
|
||||
set_officing_booth(officer_assignment.booth)
|
||||
|
||||
visit new_officing_voter_path(id: voter.user.id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user