|
|
|
|
@ -612,9 +612,9 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
context "with scheme that's deactivating soon" do |
|
|
|
|
let(:scheme_deactivation_period) { create(:scheme_deactivation_period, deactivation_date: Time.zone.local(2022, 10, 12), scheme:) } |
|
|
|
|
|
|
|
|
|
it "does not render toggle scheme link" do |
|
|
|
|
it "does render the reactivate this scheme button" do |
|
|
|
|
expect(response).to have_http_status(:ok) |
|
|
|
|
expect(page).not_to have_link("Reactivate this scheme") |
|
|
|
|
expect(page).to have_link("Reactivate this scheme") |
|
|
|
|
expect(page).not_to have_link("Deactivate this scheme") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
@ -680,9 +680,9 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
context "with scheme that's deactivating soon" do |
|
|
|
|
let(:scheme_deactivation_period) { create(:scheme_deactivation_period, deactivation_date: Time.zone.local(2022, 10, 12), scheme: specific_scheme) } |
|
|
|
|
|
|
|
|
|
it "does not render toggle scheme link" do |
|
|
|
|
it "does render the reactivate this scheme button" do |
|
|
|
|
expect(response).to have_http_status(:ok) |
|
|
|
|
expect(page).not_to have_link("Reactivate this scheme") |
|
|
|
|
expect(page).to have_link("Reactivate this scheme") |
|
|
|
|
expect(page).not_to have_link("Deactivate this scheme") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
@ -748,7 +748,7 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
let(:add_deactivations) { scheme.scheme_deactivation_periods << scheme_deactivation_period } |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
create(:location, scheme:, startdate: Time.utc(2022, 9, 9)) |
|
|
|
|
create(:location, scheme:) |
|
|
|
|
Timecop.freeze(Time.utc(2022, 10, 10)) |
|
|
|
|
sign_in user |
|
|
|
|
add_deactivations |
|
|
|
|
@ -784,7 +784,7 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
|
|
|
|
|
context "and associated logs in editable collection period" do |
|
|
|
|
before do |
|
|
|
|
create(:location, scheme:, startdate: Time.zone.local(2022, 9, 9)) |
|
|
|
|
create(:location, scheme:) |
|
|
|
|
create(:lettings_log, :sh, scheme:, startdate: Time.zone.local(2022, 9, 9), owning_organisation: user.organisation) |
|
|
|
|
get "/schemes/#{scheme.id}" |
|
|
|
|
end |
|
|
|
|
|