Fixed tests
This commit is contained in:
@@ -10,12 +10,13 @@ feature "Voter" do
|
||||
user = create(:user, :level_two)
|
||||
|
||||
login_as user
|
||||
visit question_path(question)
|
||||
visit poll_path(poll)
|
||||
|
||||
click_link 'Go to voting page'
|
||||
within("#poll_question_#{question.id}_answers") do
|
||||
click_link 'Yes'
|
||||
|
||||
expect(page).to_not have_link('Yes')
|
||||
end
|
||||
|
||||
expect(Poll::Voter.count).to eq(1)
|
||||
expect(Poll::Voter.first.origin).to eq("web")
|
||||
end
|
||||
@@ -56,7 +57,7 @@ feature "Voter" do
|
||||
|
||||
scenario "Trying to vote in web and then in booth", :js do
|
||||
login_as user
|
||||
vote_for_poll_via_web
|
||||
vote_for_poll_via_web(poll, question)
|
||||
|
||||
click_link "Sign out"
|
||||
|
||||
@@ -79,9 +80,7 @@ feature "Voter" do
|
||||
click_link "Sign out"
|
||||
|
||||
login_as user
|
||||
visit question_path(question)
|
||||
|
||||
click_link 'Go to voting page'
|
||||
visit poll_path(poll)
|
||||
|
||||
expect(page).to_not have_link('Yes')
|
||||
expect(page).to have_content "You have already participated in a booth for this poll."
|
||||
|
||||
@@ -298,13 +298,14 @@ module CommonActions
|
||||
end
|
||||
end
|
||||
|
||||
def vote_for_poll_via_web
|
||||
visit question_path(question)
|
||||
def vote_for_poll_via_web(poll, question)
|
||||
visit poll_path(poll)
|
||||
|
||||
click_link 'Go to voting page'
|
||||
within("#poll_question_#{question.id}_answers") do
|
||||
click_link 'Yes'
|
||||
|
||||
expect(page).to_not have_link('Yes')
|
||||
end
|
||||
|
||||
expect(Poll::Voter.count).to eq(1)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user