diff --git a/app/views/polls/questions/_answers.html.erb b/app/views/polls/questions/_answers.html.erb index 7d9bc4cac..206896b04 100644 --- a/app/views/polls/questions/_answers.html.erb +++ b/app/views/polls/questions/_answers.html.erb @@ -17,8 +17,16 @@ class: "button secondary hollow js-question-answer" %> <% end %> <% end %> + <% elsif !user_signed_in? %> + <% question.question_answers.order(id: :desc).each do |answer| %> + <%= link_to answer.title, new_user_session_path, class: "button secondary hollow" %> + <% end %> + <% elsif !current_user.level_two_or_three_verified? %> + <% question.question_answers.order(id: :desc).each do |answer| %> + <%= link_to answer.title, verification_path, class: "button secondary hollow" %> + <% end %> <% else %> - <% question.question_answers.each do |answer| %> + <% question.question_answers.order(id: :desc).each do |answer| %> <%= answer.title %> <% end %> <% end %> diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb index b95bb8129..a75afb8a5 100644 --- a/spec/features/polls/polls_spec.rb +++ b/spec/features/polls/polls_spec.rb @@ -179,12 +179,9 @@ feature 'Polls' do visit poll_path(poll) - expect(page).to have_content('Han Solo') - expect(page).to have_content('Chewbacca') expect(page).to have_content('You must Sign in or Sign up to participate') - - expect(page).not_to have_link('Han Solo') - expect(page).not_to have_link('Chewbacca') + expect(page).to have_link('Han Solo', href: new_user_session_path) + expect(page).to have_link('Chewbacca', href: new_user_session_path) end scenario 'Level 1 users' do @@ -203,11 +200,8 @@ feature 'Polls' do expect(page).to have_content('You must verify your account in order to answer') - expect(page).to have_content('Han Solo') - expect(page).to have_content('Chewbacca') - - expect(page).not_to have_link('Han Solo') - expect(page).not_to have_link('Chewbacca') + expect(page).to have_link('Han Solo', href: verification_path) + expect(page).to have_link('Chewbacca', href: verification_path) end scenario 'Level 2 users in an incoming poll' do