Use final trait for poll officer assignments

We were only using it in a few places.

I've left the current `final: true` statement in a few places where
using a trait would break vertical alignment, just in case.
This commit is contained in:
Javi Martín
2019-09-27 16:19:49 +02:00
parent b431273869
commit bd73c5f263

View File

@@ -83,9 +83,9 @@ describe Poll::Officer do
poll_2 = create(:poll)
poll_3 = create(:poll)
create(:poll_officer_assignment, poll: poll_1, officer: officer, date: poll_1.starts_at, final: true)
create(:poll_officer_assignment, poll: poll_1, officer: officer, date: poll_1.ends_at, final: true)
create(:poll_officer_assignment, poll: poll_2, officer: officer, final: true)
create(:poll_officer_assignment, :final, poll: poll_1, officer: officer, date: poll_1.starts_at)
create(:poll_officer_assignment, :final, poll: poll_1, officer: officer, date: poll_1.ends_at)
create(:poll_officer_assignment, :final, poll: poll_2, officer: officer)
create(:poll_officer_assignment, poll: poll_3, officer: officer)
assigned_polls = officer.final_days_assigned_polls
@@ -115,7 +115,7 @@ describe Poll::Officer do
poll_3 = create(:poll, ends_at: 10.days.ago)
[poll_1, poll_2, poll_3].each do |poll|
create(:poll_officer_assignment, officer: officer, poll: poll, final: true)
create(:poll_officer_assignment, :final, officer: officer, poll: poll)
end
assigned_polls = officer.final_days_assigned_polls