Added first poll results tests

This commit is contained in:
María Checa
2017-10-19 12:17:49 +02:00
parent f029cc2016
commit 8be8bb07f9
3 changed files with 31 additions and 5 deletions

View File

@@ -299,12 +299,12 @@ module CommonActions
end
end
def vote_for_poll_via_web(poll, question)
def vote_for_poll_via_web(poll, question, answer)
visit poll_path(poll)
within("#poll_question_#{question.id}_answers") do
click_link 'Yes'
expect(page).to_not have_link('Yes')
click_link "#{answer}"
expect(page).to_not have_link("#{answer}")
end
expect(Poll::Voter.count).to eq(1)