Simplify creating videos for a poll in specs

This commit is contained in:
Javi Martín
2019-09-28 01:26:11 +02:00
parent 11723fbb72
commit f535d81877
2 changed files with 10 additions and 6 deletions

View File

@@ -136,13 +136,11 @@ describe "Polls" do
end
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")
create(:poll_answer_video, poll: poll, title: "Awesome video", url: "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")
expect(page).to have_link("Awesome video", href: "youtube.com/watch?v=123")
end
scenario "Lists questions from proposals as well as regular ones" do