Fix Poll Recount model spec after default amount value added
This commit is contained in:
@@ -17,7 +17,7 @@ describe Poll::Recount do
|
||||
poll_recount.white_amount = 34
|
||||
poll_recount.save
|
||||
|
||||
expect(poll_recount.white_amount_log).to eq(":33:32")
|
||||
expect(poll_recount.white_amount_log).to eq(":0:33:32")
|
||||
end
|
||||
|
||||
it "should update null_amount_log if null_amount changes" do
|
||||
@@ -32,7 +32,7 @@ describe Poll::Recount do
|
||||
poll_recount.null_amount = 34
|
||||
poll_recount.save
|
||||
|
||||
expect(poll_recount.null_amount_log).to eq(":33:32")
|
||||
expect(poll_recount.null_amount_log).to eq(":0:33:32")
|
||||
end
|
||||
|
||||
it "should update total_amount_log if total_amount changes" do
|
||||
@@ -47,7 +47,7 @@ describe Poll::Recount do
|
||||
poll_recount.total_amount = 34
|
||||
poll_recount.save
|
||||
|
||||
expect(poll_recount.total_amount_log).to eq(":33:32")
|
||||
expect(poll_recount.total_amount_log).to eq(":0:33:32")
|
||||
end
|
||||
|
||||
it "should update officer_assignment_id_log if amount changes" do
|
||||
@@ -68,7 +68,7 @@ describe Poll::Recount do
|
||||
poll_recount.officer_assignment = create(:poll_officer_assignment, id: 103)
|
||||
poll_recount.save
|
||||
|
||||
expect(poll_recount.white_amount_log).to eq(":33:32")
|
||||
expect(poll_recount.white_amount_log).to eq(":0:33:32")
|
||||
expect(poll_recount.officer_assignment_id_log).to eq(":101:102")
|
||||
end
|
||||
|
||||
@@ -78,24 +78,24 @@ describe Poll::Recount do
|
||||
expect(poll_recount.white_amount_log).to eq("")
|
||||
expect(poll_recount.author_id_log).to eq("")
|
||||
|
||||
author_A = create(:poll_officer).user
|
||||
author_B = create(:poll_officer).user
|
||||
author_C = create(:poll_officer).user
|
||||
first_author = create(:poll_officer).user
|
||||
second_author = create(:poll_officer).user
|
||||
third_author = create(:poll_officer).user
|
||||
|
||||
poll_recount.white_amount = 33
|
||||
poll_recount.author_id = author_A.id
|
||||
poll_recount.author_id = first_author.id
|
||||
poll_recount.save!
|
||||
|
||||
poll_recount.white_amount = 32
|
||||
poll_recount.author_id = author_B.id
|
||||
poll_recount.author_id = second_author.id
|
||||
poll_recount.save!
|
||||
|
||||
poll_recount.white_amount = 34
|
||||
poll_recount.author_id = author_C.id
|
||||
poll_recount.author_id = third_author.id
|
||||
poll_recount.save!
|
||||
|
||||
expect(poll_recount.white_amount_log).to eq(":33:32")
|
||||
expect(poll_recount.author_id_log).to eq(":#{author_A.id}:#{author_B.id}")
|
||||
expect(poll_recount.white_amount_log).to eq(":0:33:32")
|
||||
expect(poll_recount.author_id_log).to eq(":#{first_author.id}:#{second_author.id}:#{third_author.id}")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user