|
|
|
|
@ -1251,6 +1251,12 @@ RSpec.describe LettingsLog, type: :model do
|
|
|
|
|
context "and it is 2025", metadata: { year: 25 } do |
|
|
|
|
let(:startdate) { collection_start_date_for_year(2025) } |
|
|
|
|
|
|
|
|
|
around do |example| |
|
|
|
|
Timecop.freeze(collection_start_date_for_year(2025)) do |
|
|
|
|
example.run |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not clear the relationship" do |
|
|
|
|
expect { log.set_derived_fields! }.to not_change(log, :relat2) |
|
|
|
|
end |
|
|
|
|
@ -1259,6 +1265,13 @@ RSpec.describe LettingsLog, type: :model do
|
|
|
|
|
context "and it is 2026", metadata: { year: 26 } do |
|
|
|
|
let(:startdate) { collection_start_date_for_year(2026) } |
|
|
|
|
|
|
|
|
|
around do |example| |
|
|
|
|
Timecop.freeze(collection_start_date_for_year(2026)) do |
|
|
|
|
Singleton.__init__(FormHandler) |
|
|
|
|
example.run |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "clears the relationship" do |
|
|
|
|
expect { log.set_derived_fields! }.to change(log, :relat2).from("X").to(nil) |
|
|
|
|
end |
|
|
|
|
@ -1276,6 +1289,13 @@ RSpec.describe LettingsLog, type: :model do
|
|
|
|
|
context "and it is 2025", metadata: { year: 25 } do |
|
|
|
|
let(:startdate) { collection_start_date_for_year(2025) } |
|
|
|
|
|
|
|
|
|
around do |example| |
|
|
|
|
Timecop.freeze(collection_start_date_for_year(2025)) do |
|
|
|
|
Singleton.__init__(FormHandler) |
|
|
|
|
example.run |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not clear the relationship" do |
|
|
|
|
expect { log.set_derived_fields! }.to not_change(log, :relat2) |
|
|
|
|
end |
|
|
|
|
@ -1284,6 +1304,13 @@ RSpec.describe LettingsLog, type: :model do
|
|
|
|
|
context "and it is 2026", metadata: { year: 26 } do |
|
|
|
|
let(:startdate) { collection_start_date_for_year(2026) } |
|
|
|
|
|
|
|
|
|
around do |example| |
|
|
|
|
Timecop.freeze(collection_start_date_for_year(2026)) do |
|
|
|
|
Singleton.__init__(FormHandler) |
|
|
|
|
example.run |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not clear the relationship" do |
|
|
|
|
expect { log.set_derived_fields! }.to not_change(log, :relat2) |
|
|
|
|
end |
|
|
|
|
@ -1301,6 +1328,13 @@ RSpec.describe LettingsLog, type: :model do
|
|
|
|
|
context "and it is 2025", metadata: { year: 25 } do |
|
|
|
|
let(:startdate) { collection_start_date_for_year(2025) } |
|
|
|
|
|
|
|
|
|
around do |example| |
|
|
|
|
Timecop.freeze(collection_start_date_for_year(2025)) do |
|
|
|
|
Singleton.__init__(FormHandler) |
|
|
|
|
example.run |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not clear the relationship" do |
|
|
|
|
expect { log.set_derived_fields! }.to not_change(log, :relat2) |
|
|
|
|
end |
|
|
|
|
@ -1309,6 +1343,13 @@ RSpec.describe LettingsLog, type: :model do
|
|
|
|
|
context "and it is 2026", metadata: { year: 26 } do |
|
|
|
|
let(:startdate) { collection_start_date_for_year(2026) } |
|
|
|
|
|
|
|
|
|
around do |example| |
|
|
|
|
Timecop.freeze(collection_start_date_for_year(2026)) do |
|
|
|
|
Singleton.__init__(FormHandler) |
|
|
|
|
example.run |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "does not clear the relationship" do |
|
|
|
|
expect { log.set_derived_fields! }.to not_change(log, :relat2) |
|
|
|
|
end |
|
|
|
|
|