diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 8485b5468..94890e7dc 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -1769,6 +1769,7 @@ .orbit-slide { max-height: none !important; + position: relative; } .orbit-caption { diff --git a/app/views/polls/_gallery.html.erb b/app/views/polls/_gallery.html.erb index 9082e8901..1cfc4c116 100644 --- a/app/views/polls/_gallery.html.erb +++ b/app/views/polls/_gallery.html.erb @@ -1,4 +1,4 @@ -
+
<%= t("polls.show.zoom_plus") %> diff --git a/spec/system/polls/polls_spec.rb b/spec/system/polls/polls_spec.rb index ed5da64d9..4dc0b8693 100644 --- a/spec/system/polls/polls_spec.rb +++ b/spec/system/polls/polls_spec.rb @@ -190,6 +190,33 @@ describe "Polls" do end end + scenario "Answer images are shown", :js do + question = create(:poll_question, :yes_no, poll: poll) + create(:image, imageable: question.question_answers.first, title: "The yes movement") + + visit poll_path(poll) + + expect(page).to have_css "img[alt='The yes movement']" + end + + scenario "Buttons to slide through images work back and forth", :js do + question = create(:poll_question, :yes_no, poll: poll) + create(:image, imageable: question.question_answers.last, title: "The no movement") + create(:image, imageable: question.question_answers.last, title: "No movement planning") + + visit poll_path(poll) + + within(".orbit-bullets") do + find("[data-slide='1']").click + + expect(page).to have_css ".is-active[data-slide='1']" + + find("[data-slide='0']").click + + expect(page).to have_css ".is-active[data-slide='0']" + end + end + scenario "Non-logged in users" do create(:poll_question, :yes_no, poll: poll)