Browse Source

feat: fix lettings_log_spec.rb

pull/1378/head
natdeanlewissoftwire 3 years ago
parent
commit
0e55fedf49
  1. 15
      spec/models/lettings_log_spec.rb

15
spec/models/lettings_log_spec.rb

@ -1982,8 +1982,14 @@ RSpec.describe LettingsLog do
before do before do
lettings_log.needstype = 2 lettings_log.needstype = 2
allow(FormHandler.instance).to receive(:get_form).and_return(real_2021_2022_form) allow(FormHandler.instance).to receive(:get_form).and_return(real_2021_2022_form)
Timecop.freeze(2022, 4, 2)
end
after do
Timecop.unfreeze
end end
context "and a scheme with a single log is selected" do context "and a scheme with a single log is selected" do
before do before do
Timecop.freeze(2022, 4, 2) Timecop.freeze(2022, 4, 2)
@ -2063,15 +2069,8 @@ RSpec.describe LettingsLog do
created_at: Time.utc(2022, 2, 8, 16, 52, 15), created_at: Time.utc(2022, 2, 8, 16, 52, 15),
}) })
end end
let(:location) { FactoryBot.create(:location, scheme:) }
before do let(:location) { FactoryBot.create(:location, scheme:) }
Timecop.freeze(2022, 4, 2)
end
after do
Timecop.unfreeze
end
it "correctly infers and saves the renewal date" do it "correctly infers and saves the renewal date" do
record_from_db = ActiveRecord::Base.connection.execute("SELECT voiddate from lettings_logs where id=#{supported_housing_lettings_log.id}").to_a[0] record_from_db = ActiveRecord::Base.connection.execute("SELECT voiddate from lettings_logs where id=#{supported_housing_lettings_log.id}").to_a[0]

Loading…
Cancel
Save