diff --git a/spec/features/officing/booth_spec.rb b/spec/features/officing/booth_spec.rb index bbab9f53f..78fe6eeb8 100644 --- a/spec/features/officing/booth_spec.rb +++ b/spec/features/officing/booth_spec.rb @@ -5,7 +5,7 @@ feature "Booth" do scenario "Officer with no booth assignments today" do officer = create(:poll_officer) - login_through_form_as(officer.user) + login_through_form_as_officer(officer.user) expect(page).to have_content "You don't have officing shifts today" end @@ -14,7 +14,7 @@ feature "Booth" do officer = create(:poll_officer) create(:poll_officer_assignment, officer: officer, date: 1.day.from_now) - login_through_form_as(officer.user) + login_through_form_as_officer(officer.user) expect(page).to have_content "You don't have officing shifts today" end @@ -28,7 +28,7 @@ feature "Booth" do booth_assignment = create(:poll_booth_assignment, poll: poll, booth: booth) create(:poll_officer_assignment, officer: officer, booth_assignment: booth_assignment, date: Date.today) - login_through_form_as(officer.user) + login_through_form_as_officer(officer.user) within("#officing-booth") do expect(page).to have_content "You are officing the booth located at #{booth.location}." @@ -48,9 +48,8 @@ feature "Booth" do create(:poll_officer_assignment, officer: officer, booth_assignment: ba1, date: Date.today) create(:poll_officer_assignment, officer: officer, booth_assignment: ba2, date: Date.today) - login_through_form_as(officer.user) + login_through_form_as_officer(officer.user) - expect(page).to have_content "You have been signed in successfully." expect(page).to have_content "Choose your booth" select booth2.location, from: "booth_id" @@ -78,9 +77,8 @@ feature "Booth" do create(:poll_officer_assignment, officer: officer, booth_assignment: ba2, date: Date.today) create(:poll_officer_assignment, officer: officer, booth_assignment: ba3, date: Date.today) - login_through_form_as(officer.user) + login_through_form_as_officer(officer.user) - expect(page).to have_content "You have been signed in successfully." expect(page).to have_content "Choose your booth" expect(page).to have_select("booth_id", options: [booth1.location, booth2.location]) diff --git a/spec/features/officing/residence_spec.rb b/spec/features/officing/residence_spec.rb index c956bc31d..c4c7784bc 100644 --- a/spec/features/officing/residence_spec.rb +++ b/spec/features/officing/residence_spec.rb @@ -25,7 +25,7 @@ feature "Residence", :with_frozen_time do background do create(:poll_officer_assignment, officer: officer) - login_through_form_as(officer.user) + login_through_form_as_officer(officer.user) visit officing_root_path end diff --git a/spec/features/officing/voters_spec.rb b/spec/features/officing/voters_spec.rb index 264319f70..61b9ea221 100644 --- a/spec/features/officing/voters_spec.rb +++ b/spec/features/officing/voters_spec.rb @@ -61,7 +61,7 @@ feature "Voters" do visit root_path click_link "Sign out" - login_through_form_as(officer.user) + login_through_form_as_officer(officer.user) visit new_officing_residence_path officing_verify_residence diff --git a/spec/features/officing_spec.rb b/spec/features/officing_spec.rb index 0d865b13f..fe03d5eef 100644 --- a/spec/features/officing_spec.rb +++ b/spec/features/officing_spec.rb @@ -97,6 +97,7 @@ feature "Poll Officing" do end scenario "Poll officer access links" do + create(:poll) create(:poll_officer, user: user) login_as(user) visit root_path