Remove unnecessary poll creating assignments
The factory creating assignments automatically assigns a poll to it, so we don't use the poll for anything else, there's no need to explicitely create it.
This commit is contained in:
@@ -3,9 +3,8 @@ require "rails_helper"
|
|||||||
describe "Budget Poll Officing" do
|
describe "Budget Poll Officing" do
|
||||||
|
|
||||||
scenario "Show sidebar menus if officer has shifts assigned" do
|
scenario "Show sidebar menus if officer has shifts assigned" do
|
||||||
poll = create(:poll)
|
|
||||||
booth = create(:poll_booth)
|
booth = create(:poll_booth)
|
||||||
booth_assignment = create(:poll_booth_assignment, poll: poll, booth: booth)
|
booth_assignment = create(:poll_booth_assignment, booth: booth)
|
||||||
|
|
||||||
user = create(:user)
|
user = create(:user)
|
||||||
officer = create(:poll_officer, user: user)
|
officer = create(:poll_officer, user: user)
|
||||||
|
|||||||
@@ -57,10 +57,8 @@ describe Poll::Shift do
|
|||||||
describe "officer_assignments" do
|
describe "officer_assignments" do
|
||||||
|
|
||||||
it "creates and destroy corresponding officer_assignments" do
|
it "creates and destroy corresponding officer_assignments" do
|
||||||
poll2 = create(:poll)
|
booth_assignment1 = create(:poll_booth_assignment, booth: booth)
|
||||||
|
booth_assignment2 = create(:poll_booth_assignment, booth: booth)
|
||||||
booth_assignment1 = create(:poll_booth_assignment, poll: poll, booth: booth)
|
|
||||||
booth_assignment2 = create(:poll_booth_assignment, poll: poll2, booth: booth)
|
|
||||||
|
|
||||||
expect { create(:poll_shift, booth: booth, officer: officer, date: Date.current) }.to change { Poll::OfficerAssignment.all.count }.by(2)
|
expect { create(:poll_shift, booth: booth, officer: officer, date: Date.current) }.to change { Poll::OfficerAssignment.all.count }.by(2)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user