makes specs more robust
This commit is contained in:
@@ -126,9 +126,10 @@ feature 'Admin booths assignments' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Results' do
|
scenario 'Results for a booth assignment' do
|
||||||
poll = create(:poll)
|
poll = create(:poll)
|
||||||
booth_assignment = create(:poll_booth_assignment, poll: poll)
|
booth_assignment = create(:poll_booth_assignment, poll: poll)
|
||||||
|
other_booth_assignment = create(:poll_booth_assignment, poll: poll)
|
||||||
|
|
||||||
question_1 = create(:poll_question, poll: poll)
|
question_1 = create(:poll_question, poll: poll)
|
||||||
create(:poll_question_answer, title: 'Yes', question: question_1)
|
create(:poll_question_answer, title: 'Yes', question: question_1)
|
||||||
@@ -162,12 +163,24 @@ feature 'Admin booths assignments' do
|
|||||||
answer: 'Tomorrow',
|
answer: 'Tomorrow',
|
||||||
amount: 6)
|
amount: 6)
|
||||||
|
|
||||||
|
create(:poll_partial_result,
|
||||||
|
booth_assignment: other_booth_assignment,
|
||||||
|
question: question_1,
|
||||||
|
answer: 'Yes',
|
||||||
|
amount: 9999)
|
||||||
|
|
||||||
create(:poll_recount,
|
create(:poll_recount,
|
||||||
booth_assignment: booth_assignment,
|
booth_assignment: booth_assignment,
|
||||||
white_amount: 21,
|
white_amount: 21,
|
||||||
null_amount: 44,
|
null_amount: 44,
|
||||||
total_amount: 66)
|
total_amount: 66)
|
||||||
|
|
||||||
|
create(:poll_recount,
|
||||||
|
booth_assignment: other_booth_assignment,
|
||||||
|
white_amount: 999,
|
||||||
|
null_amount: 999,
|
||||||
|
total_amount: 999)
|
||||||
|
|
||||||
visit admin_poll_booth_assignment_path(poll, booth_assignment)
|
visit admin_poll_booth_assignment_path(poll, booth_assignment)
|
||||||
|
|
||||||
click_link 'Results'
|
click_link 'Results'
|
||||||
|
|||||||
Reference in New Issue
Block a user