fixes specs

This commit is contained in:
rgarcia
2017-03-21 17:01:22 +01:00
committed by Javi Martín
parent 0acec655e2
commit 88c801d6c5
4 changed files with 8 additions and 9 deletions

View File

@@ -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])

View File

@@ -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

View File

@@ -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

View File

@@ -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