@@ -41,6 +41,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"
|
||||
|
||||
|
||||
@@ -65,6 +65,16 @@ feature 'Polls' do
|
||||
let(:geozone) { create(:geozone) }
|
||||
let(:poll) { create(:poll, summary: "Summary", description: "Description") }
|
||||
|
||||
scenario 'Show answers with videos' do
|
||||
question = create(:poll_question, poll: poll)
|
||||
answer = create(:poll_question_answer, question: question, title: 'Chewbacca')
|
||||
video = create(:poll_answer_video, answer: answer, title: "Awesome project video", url: "https://www.youtube.com/watch?v=123")
|
||||
|
||||
visit poll_path(poll)
|
||||
|
||||
expect(page).to have_link("Awesome project video", href: "https://www.youtube.com/watch?v=123")
|
||||
end
|
||||
|
||||
scenario 'Lists questions from proposals as well as regular ones' do
|
||||
normal_question = create(:poll_question, poll: poll)
|
||||
proposal_question = create(:poll_question, poll: poll, proposal: create(:proposal))
|
||||
|
||||
Reference in New Issue
Block a user