Browse Source

Update tests

pull/2855/head
Kat 1 year ago
parent
commit
d05361cabf
  1. 14
      spec/models/lettings_log_spec.rb
  2. 16
      spec/models/sales_log_spec.rb

14
spec/models/lettings_log_spec.rb

@ -836,19 +836,6 @@ RSpec.describe LettingsLog do
end
end
context "when startdate is before 2023" do
let(:lettings_log) { build(:lettings_log, startdate: Time.zone.parse("2022-07-01")) }
it "returns optional fields" do
expect(lettings_log.optional_fields).to eq(%w[
tenancycode
propcode
chcharge
tenancylength
])
end
end
context "when startdate is after 2023" do
let(:lettings_log) { build(:lettings_log, startdate: Time.zone.parse("2023-07-01")) }
@ -860,7 +847,6 @@ RSpec.describe LettingsLog do
tenancylength
address_line2
county
postcode_full
])
end
end

16
spec/models/sales_log_spec.rb

@ -76,21 +76,6 @@ RSpec.describe SalesLog, type: :model do
end
describe "#optional_fields" do
context "when saledate is before 2023" do
let(:sales_log) { build(:sales_log, saledate: Time.zone.parse("2022-07-01")) }
it "returns optional fields" do
expect(sales_log.optional_fields).to eq(%w[
purchid
othtype
buyers_organisations
proplen
mortlen
frombeds
])
end
end
context "when saledate is after 2023" do
let(:sales_log) { build(:sales_log, saledate: Time.zone.parse("2023-07-01")) }
@ -101,7 +86,6 @@ RSpec.describe SalesLog, type: :model do
buyers_organisations
address_line2
county
postcode_full
])
end
end

Loading…
Cancel
Save