Browse Source

Fix test failures due to BST changeover (#2283)

pull/2281/head^2
Robert Sullivan 11 months ago committed by GitHub
parent
commit
6d2fc66670
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      spec/services/merge/merge_organisations_service_spec.rb

15
spec/services/merge/merge_organisations_service_spec.rb

@ -221,19 +221,21 @@ RSpec.describe Merge::MergeOrganisationsService do
expect(absorbed_scheme.locations.count).to eq(1) expect(absorbed_scheme.locations.count).to eq(1)
absorbed_location = absorbed_scheme.locations.first absorbed_location = absorbed_scheme.locations.first
expect(absorbed_scheme.startdate).to eq(Time.zone.today + 1.month) expected_date = Time.zone.today + 1.month
expect(absorbed_location.startdate).to eq(Time.zone.today + 1.month) expect(absorbed_scheme.startdate).to eq(expected_date.in_time_zone)
expect(absorbed_location.startdate).to eq(expected_date.in_time_zone)
end end
it "deactivates schemes and locations on the merged organisation on the startdate" do it "deactivates schemes and locations on the merged organisation on the startdate" do
merge_organisations_service.call merge_organisations_service.call
expected_date = Time.zone.today + 1.month
expect(scheme.owning_organisation).to eq(merging_organisation) expect(scheme.owning_organisation).to eq(merging_organisation)
expect(location.scheme).to eq(scheme) expect(location.scheme).to eq(scheme)
expect(scheme.scheme_deactivation_periods.count).to eq(1) expect(scheme.scheme_deactivation_periods.count).to eq(1)
expect(scheme.scheme_deactivation_periods.first.deactivation_date).to eq(Time.zone.today + 1.month) expect(scheme.scheme_deactivation_periods.first.deactivation_date).to eq(expected_date.in_time_zone)
expect(location.location_deactivation_periods.count).to eq(1) expect(location.location_deactivation_periods.count).to eq(1)
expect(location.location_deactivation_periods.first.deactivation_date).to eq(Time.zone.today + 1.month) expect(location.location_deactivation_periods.first.deactivation_date).to eq(expected_date.in_time_zone)
end end
end end
end end
@ -376,15 +378,16 @@ RSpec.describe Merge::MergeOrganisationsService do
expect(absorbed_scheme.locations.count).to eq(1) expect(absorbed_scheme.locations.count).to eq(1)
absorbed_location = absorbed_scheme.locations.first absorbed_location = absorbed_scheme.locations.first
expected_reactivation_date = Time.zone.today + 1.month
expect(absorbed_scheme.startdate).to eq(Time.zone.today) expect(absorbed_scheme.startdate).to eq(Time.zone.today)
expect(absorbed_scheme.scheme_deactivation_periods.count).to eq(1) expect(absorbed_scheme.scheme_deactivation_periods.count).to eq(1)
expect(absorbed_scheme.scheme_deactivation_periods.first.deactivation_date).to eq(Time.zone.today) expect(absorbed_scheme.scheme_deactivation_periods.first.deactivation_date).to eq(Time.zone.today)
expect(absorbed_scheme.scheme_deactivation_periods.first.reactivation_date).to eq(Time.zone.today + 1.month) expect(absorbed_scheme.scheme_deactivation_periods.first.reactivation_date).to eq(expected_reactivation_date.in_time_zone)
expect(absorbed_location.startdate).to eq(Time.zone.today) expect(absorbed_location.startdate).to eq(Time.zone.today)
expect(absorbed_location.location_deactivation_periods.count).to eq(1) expect(absorbed_location.location_deactivation_periods.count).to eq(1)
expect(absorbed_location.location_deactivation_periods.first.deactivation_date).to eq(Time.zone.today) expect(absorbed_location.location_deactivation_periods.first.deactivation_date).to eq(Time.zone.today)
expect(absorbed_location.location_deactivation_periods.first.reactivation_date).to eq(Time.zone.today + 1.month) expect(absorbed_location.location_deactivation_periods.first.reactivation_date).to eq(expected_reactivation_date.in_time_zone)
end end
it "deactivates schemes and locations on the merged organisation" do it "deactivates schemes and locations on the merged organisation" do

Loading…
Cancel
Save