Browse Source

Reload location/scheme after saving in tests (#2926)

* Reload location after saving in test

* Reload scheme after saving
pull/2918/merge
kosiakkatrina 2 days ago committed by GitHub
parent
commit
007f0b63c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      spec/models/location_spec.rb
  2. 1
      spec/models/scheme_spec.rb

1
spec/models/location_spec.rb

@ -1024,6 +1024,7 @@ RSpec.describe Location, type: :model do
it "returns reactivating soon if the location had a deactivation during another deactivation" do
FactoryBot.create(:location_deactivation_period, deactivation_date: Time.zone.today - 1.month, reactivation_date: Time.zone.today + 2.days, location:)
location.save!
location.reload
expect(location.status).to eq(:reactivating_soon)
end

1
spec/models/scheme_spec.rb

@ -435,6 +435,7 @@ RSpec.describe Scheme, type: :model do
it "returns reactivating soon if the scheme had a deactivation during another deactivation" do
FactoryBot.create(:scheme_deactivation_period, deactivation_date: Time.zone.today - 2.months, reactivation_date: Time.zone.today + 2.days, scheme:)
scheme.save!
scheme.reload
expect(scheme.status).to eq(:reactivating_soon)
end

Loading…
Cancel
Save