From c9a3bcc65a7539ba6fbb0477a04e7d367923b4ab Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 16 Oct 2017 13:14:15 +0200 Subject: [PATCH] adds admin polls answer video specs --- spec/features/polls/answers_spec.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/spec/features/polls/answers_spec.rb b/spec/features/polls/answers_spec.rb index f7dfd4d38..54890610e 100644 --- a/spec/features/polls/answers_spec.rb +++ b/spec/features/polls/answers_spec.rb @@ -39,6 +39,31 @@ feature 'Answers' do expect(page).to have_content "Adding more trees, creating a play area..." end + + scenario 'Add video to answer' do + question = create(:poll_question) + answer1 = create(:poll_question_answer, question: question) + answer2 = create(:poll_question_answer, question: question) + + visit admin_question_path(question) + + within("#poll_question_answer_#{answer1.id}") do + click_link "Video list" + end + + click_link "Add video" + + fill_in "poll_question_answer_video_title", with: "Awesome project video" + fill_in "poll_question_answer_video_url", with: "https://www.youtube.com/watch?v=123" + + click_button "Save" + + within("#poll_question_answer_video_#{answer1.id}") do + expect(page).to have_content "Awesome project video" + expect(page).to have_content "https://www.youtube.com/watch?v=123" + end + end + pending "Update" pending "Destroy"