Use yes_no trait to simplify creating answers

We lose some variety in our answers, though, but on the plus side, we
reduce the risk of trademark issues :P.
This commit is contained in:
Javi Martín
2019-09-24 21:14:56 +02:00
parent 19a41eb651
commit 4edab79910
4 changed files with 58 additions and 95 deletions

View File

@@ -133,9 +133,7 @@ describe "Admin polls" do
scenario "Can destroy poll with questions and answers", :js do
poll = create(:poll)
question = create(:poll_question, poll: poll)
create(:poll_question_answer, question: question, title: "Yes")
create(:poll_question_answer, question: question, title: "No")
question = create(:poll_question, :yes_no, poll: poll)
visit admin_polls_path
@@ -438,9 +436,7 @@ describe "Admin polls" do
booth_assignment_2 = create(:poll_booth_assignment, poll: poll)
booth_assignment_3 = create(:poll_booth_assignment, poll: poll)
question_1 = create(:poll_question, poll: poll)
create(:poll_question_answer, title: "Yes", question: question_1)
create(:poll_question_answer, title: "No", question: question_1)
question_1 = create(:poll_question, :yes_no, poll: poll)
question_2 = create(:poll_question, poll: poll)
create(:poll_question_answer, title: "Today", question: question_2)
@@ -494,9 +490,7 @@ describe "Admin polls" do
booth_assignment1 = create(:poll_booth_assignment, poll: poll)
booth_assignment2 = create(:poll_booth_assignment, poll: poll)
question = create(:poll_question, poll: poll)
create(:poll_question_answer, title: "Yes", question: question)
create(:poll_question_answer, title: "No", question: question)
question = create(:poll_question, :yes_no, poll: poll)
create(:poll_partial_result,
booth_assignment: booth_assignment1,