diff --git a/spec/features/admin/poll/questions_spec.rb b/spec/features/admin/poll/questions_spec.rb index e9b9f277a..392b2aabf 100644 --- a/spec/features/admin/poll/questions_spec.rb +++ b/spec/features/admin/poll/questions_spec.rb @@ -38,6 +38,7 @@ feature 'Admin poll questions' do Pursued by the Empire's sinister agents, Princess Leia races home aboard her starship, custodian of the stolen plans that can save her people and restore freedom to the galaxy.... } + video_url = "https://puppyvideos.com" visit admin_questions_path click_link "Create question" @@ -45,11 +46,13 @@ feature 'Admin poll questions' do select 'Movies', from: 'poll_question_poll_id' fill_in 'poll_question_title', with: title fill_in 'poll_question_description', with: description + fill_in 'poll_question_video_url', with: video_url click_button 'Save' expect(page).to have_content(title) expect(page).to have_content(description) + expect(page).to have_content(video_url) end scenario 'Create from successful proposal index' do diff --git a/spec/features/polls/questions_spec.rb b/spec/features/polls/questions_spec.rb index 6f2225175..7368c7857 100644 --- a/spec/features/polls/questions_spec.rb +++ b/spec/features/polls/questions_spec.rb @@ -25,6 +25,25 @@ feature 'Poll Questions' do expect(page).to have_content(question_with_author_visible_name.author_visible_name) end + scenario '#show view has video_url present' do + poll = create(:poll) + normal_question = create(:poll_question, poll: poll, video_url: "https://puppyvideos.com") + + visit question_path(normal_question) + + expect(page).to have_link(normal_question.video_url) + end + + scenario '#show view has document present' do + poll = create(:poll) + normal_question = create(:poll_question, poll: poll) + document = create(:document, documentable: normal_question) + + visit question_path(normal_question) + + expect(page).to have_link(document.title) + end + context 'Answering' do let(:geozone) { create(:geozone) } let(:poll) { create(:poll, geozone_restricted: true, geozone_ids: [geozone.id]) }