Totally remove Poll::FinalRecount model, table spec and factory

This commit is contained in:
Bertocq
2017-09-19 01:22:30 +02:00
parent a3bf69e78d
commit 2e3b5aad49
6 changed files with 12 additions and 84 deletions

View File

@@ -507,13 +507,6 @@ FactoryGirl.define do
date Date.current
end
factory :poll_final_recount, class: 'Poll::FinalRecount' do
association :officer_assignment, factory: [:poll_officer_assignment, :final]
association :booth_assignment, factory: :poll_booth_assignment
count (1..100).to_a.sample
date (1.month.ago.to_datetime..1.month.from_now.to_datetime).to_a.sample
end
factory :poll_voter, class: 'Poll::Voter' do
poll
association :user, :level_two

View File

@@ -1,40 +0,0 @@
require 'rails_helper'
describe :final_recount do
it "should update count_log if count changes" do
final_recount = create(:poll_final_recount, count: 33)
expect(final_recount.count_log).to eq("")
final_recount.count = 33
final_recount.save
final_recount.count = 32
final_recount.save
final_recount.count = 34
final_recount.save
expect(final_recount.count_log).to eq(":33:32")
end
it "should update officer_assignment_id_log if count changes" do
final_recount = create(:poll_final_recount, count: 33)
expect(final_recount.count_log).to eq("")
final_recount.count = 33
final_recount.officer_assignment = create(:poll_officer_assignment, id: 111)
final_recount.save
final_recount.count = 32
final_recount.officer_assignment = create(:poll_officer_assignment, id: 112)
final_recount.save
final_recount.count = 34
final_recount.officer_assignment = create(:poll_officer_assignment, id: 113)
final_recount.save
expect(final_recount.officer_assignment_id_log).to eq(":111:112")
end
end