Remove unnecessary extra expectation for 'Voting in booth' scenario
This commit is contained in:
@@ -53,7 +53,7 @@ feature "Voter" do
|
||||
expect(page).not_to have_content("You have already participated in this poll. If you vote again it will be overwritten")
|
||||
end
|
||||
|
||||
scenario "Voting in booth", :js do
|
||||
scenario 'Voting in booth', :js do
|
||||
user = create(:user, :in_census)
|
||||
|
||||
login_through_form_as_officer(officer.user)
|
||||
@@ -64,23 +64,18 @@ feature "Voter" do
|
||||
expect(page).to have_content poll.name
|
||||
|
||||
within("#poll_#{poll.id}") do
|
||||
click_button("Confirm vote")
|
||||
expect(page).not_to have_button("Confirm vote")
|
||||
expect(page).to have_button('Wait, confirming vote...', disabled: true)
|
||||
expect(page).to have_content "Vote introduced!"
|
||||
click_button('Confirm vote')
|
||||
expect(page).not_to have_button('Confirm vote')
|
||||
expect(page).to have_content('Vote introduced!')
|
||||
end
|
||||
|
||||
expect(Poll::Voter.count).to eq(1)
|
||||
expect(Poll::Voter.first.origin).to eq("booth")
|
||||
expect(Poll::Voter.first.origin).to eq('booth')
|
||||
end
|
||||
|
||||
context "Trying to vote the same poll in booth and web" do
|
||||
|
||||
let!(:user) { create(:user, :in_census) }
|
||||
|
||||
background do
|
||||
end
|
||||
|
||||
scenario "Trying to vote in web and then in booth", :js do
|
||||
login_as user
|
||||
vote_for_poll_via_web(poll, question, answer_yes.title)
|
||||
|
||||
Reference in New Issue
Block a user