Browse Source

fixup! CLDC-4325: Fix sales log spec in 2025

pull/3250/head
samyou-softwire 2 weeks ago
parent
commit
2f6d9329bd
  1. 12
      spec/models/sales_log_spec.rb

12
spec/models/sales_log_spec.rb

@ -725,13 +725,13 @@ RSpec.describe SalesLog, type: :model do
let(:saledate) { collection_start_date_for_year(2025) } let(:saledate) { collection_start_date_for_year(2025) }
let(:hholdcount) { 4 } let(:hholdcount) { 4 }
it "correctly derives and saves hhmemb" do it "correctly derives and saves hhmemb if it's a joint purchase" do
record_from_db = described_class.find(sales_log.id) record_from_db = described_class.find(sales_log.id)
expect(record_from_db["hhmemb"]).to eq(6) expect(record_from_db["hhmemb"]).to eq(6)
end end
it "correctly derives and saves hhmemb if it's a joint purchase" do it "correctly derives and saves hhmemb if it's not a joint purchase" do
sales_log.update!(jointpur: 2, jointmore: 2) sales_log.update!(jointpur: 2)
record_from_db = described_class.find(sales_log.id) record_from_db = described_class.find(sales_log.id)
expect(record_from_db["hhmemb"]).to eq(5) expect(record_from_db["hhmemb"]).to eq(5)
end end
@ -756,13 +756,13 @@ RSpec.describe SalesLog, type: :model do
let(:saledate) { collection_start_date_for_year_or_later(2026) } let(:saledate) { collection_start_date_for_year_or_later(2026) }
let(:hholdcount) { 6 } let(:hholdcount) { 6 }
it "correctly derives and saves hhmemb" do it "correctly derives and saves hhmemb if it's a joint purchase" do
record_from_db = described_class.find(sales_log.id) record_from_db = described_class.find(sales_log.id)
expect(record_from_db["hhmemb"]).to eq(6) expect(record_from_db["hhmemb"]).to eq(6)
end end
it "correctly derives and saves hhmemb if it's a joint purchase" do it "correctly derives and saves hhmemb if it's not a joint purchase" do
sales_log.update!(jointpur: 2, jointmore: 2) sales_log.update!(jointpur: 2)
record_from_db = described_class.find(sales_log.id) record_from_db = described_class.find(sales_log.id)
expect(record_from_db["hhmemb"]).to eq(6) expect(record_from_db["hhmemb"]).to eq(6)
end end

Loading…
Cancel
Save