As mentioned in commits5311daadfandbb958daf0, using links combined with JavaScript to generate POST requests to the server has a few issues.
23 lines
777 B
Ruby
23 lines
777 B
Ruby
module Votes
|
|
def expect_message_you_need_to_sign_in
|
|
expect(page).to have_content "You must sign in or sign up to continue"
|
|
expect(page).to have_selector(".in-favor", obscured: true)
|
|
end
|
|
|
|
def expect_message_you_need_to_sign_in_to_vote_comments
|
|
within(".participation-not-allowed") do
|
|
expect(page).to have_content "You must sign in or sign up to vote"
|
|
end
|
|
end
|
|
|
|
def expect_message_to_many_anonymous_votes
|
|
expect(page).to have_content "Too many anonymous votes to admit vote"
|
|
expect(page).to have_button "I agree", obscured: true
|
|
end
|
|
|
|
def expect_message_only_verified_can_vote_proposals
|
|
expect(page).to have_content "Only verified users can vote on proposals"
|
|
expect(page).to have_selector(".in-favor", obscured: true)
|
|
end
|
|
end
|