Browse Source

Merge branch 'main' into CLDC-1669-add-location-redesign

# Conflicts:
#	db/schema.rb
pull/1034/head
natdeanlewissoftwire 4 years ago
parent
commit
b7b8f26064
  1. 10
      .github/workflows/review_pipeline.yml
  2. 5
      app/controllers/locations_controller.rb
  3. 7
      app/controllers/schemes_controller.rb
  4. 15
      app/models/form/sales/pages/buyer1_mortgage.rb
  5. 19
      app/models/form/sales/pages/buyer2_income.rb
  6. 16
      app/models/form/sales/questions/buyer1_mortgage.rb
  7. 14
      app/models/form/sales/questions/buyer2_income.rb
  8. 21
      app/models/form/sales/questions/buyer2_income_known.rb
  9. 2
      app/models/form/sales/sections/finances.rb
  10. 15
      app/models/form/sales/subsections/income_benefits_and_outgoings.rb
  11. 17
      app/models/form/sales/subsections/income_benefits_and_savings.rb
  12. 2
      app/views/locations/deactivate_confirm.html.erb
  13. 2
      app/views/schemes/deactivate_confirm.html.erb
  14. 7
      db/migrate/20221124102329_add_mortgage1_to_sales.rb
  15. 6
      db/migrate/20221125142847_add_buyer2_to_sales.rb
  16. 11
      db/schema.rb
  17. 3
      spec/factories/sales_log.rb
  18. 33
      spec/models/form/sales/pages/buyer1_mortgage_spec.rb
  19. 33
      spec/models/form/sales/pages/buyer2_income_spec.rb
  20. 40
      spec/models/form/sales/questions/buyer1_mortgage_spec.rb
  21. 55
      spec/models/form/sales/questions/buyer2_income_known_spec.rb
  22. 53
      spec/models/form/sales/questions/buyer2_income_spec.rb
  23. 2
      spec/models/form/sales/sections/finances_spec.rb
  24. 8
      spec/models/form/sales/subsections/income_benefits_and_savings_spec.rb
  25. 4
      spec/models/form_handler_spec.rb
  26. 15
      spec/models/scheme_spec.rb
  27. 36
      spec/requests/locations_controller_spec.rb
  28. 36
      spec/requests/schemes_controller_spec.rb

10
.github/workflows/review_pipeline.yml

@ -1,5 +1,7 @@
name: Review app pipeline
concurrency: ${{ github.workflow }}-${{ github.event.pull_request.number }}
on:
pull_request:
types:
@ -143,6 +145,14 @@ jobs:
run: |
cf bind-service $APP_NAME $SERVICE_NAME --wait
- name: Bind S3 buckets services
env:
APP_NAME: dluhc-core-review-${{ github.event.pull_request.number }}
run: |
cf bind-service $APP_NAME dluhc-core-review-csv-bucket --wait
cf bind-service $APP_NAME dluhc-core-review-export-bucket --wait
cf bind-service $APP_NAME dluhc-core-review-import-bucket --wait
- name: Start review app
env:
APP_NAME: dluhc-core-review-${{ github.event.pull_request.number }}

5
app/controllers/locations_controller.rb

@ -178,9 +178,14 @@ class LocationsController < ApplicationController
end
def deactivate_confirm
@affected_logs = @location.lettings_logs.filter_by_before_startdate(params[:deactivation_date])
if @affected_logs.count.zero?
deactivate
else
@deactivation_date = params[:deactivation_date]
@deactivation_date_type = params[:deactivation_date_type]
end
end
def deactivate
if @location.location_deactivation_periods.create!(deactivation_date: params[:deactivation_date]) && reset_location_and_scheme_for_logs!

7
app/controllers/schemes_controller.rb

@ -9,7 +9,7 @@ class SchemesController < ApplicationController
def index
redirect_to schemes_organisation_path(current_user.organisation) unless current_user.support?
all_schemes = Scheme.all.order("service_name ASC")
all_schemes = Scheme.order(confirmed: :asc, service_name: :asc)
@pagy, @schemes = pagy(filtered_collection(all_schemes, search_term))
@searched = search_term.presence
@ -39,9 +39,14 @@ class SchemesController < ApplicationController
end
def deactivate_confirm
@affected_logs = @scheme.lettings_logs.filter_by_before_startdate(params[:deactivation_date])
if @affected_logs.count.zero?
deactivate
else
@deactivation_date = params[:deactivation_date]
@deactivation_date_type = params[:deactivation_date_type]
end
end
def deactivate
if @scheme.scheme_deactivation_periods.create!(deactivation_date: params[:deactivation_date]) && reset_location_and_scheme_for_logs!

15
app/models/form/sales/pages/buyer1_mortgage.rb

@ -0,0 +1,15 @@
class Form::Sales::Pages::Buyer1Mortgage < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_1_mortgage"
@header = ""
@description = ""
@subsection = subsection
end
def questions
@questions ||= [
Form::Sales::Questions::Buyer1Mortgage.new(nil, nil, self),
]
end
end

19
app/models/form/sales/pages/buyer2_income.rb

@ -0,0 +1,19 @@
class Form::Sales::Pages::Buyer2Income < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_2_income"
@header = ""
@description = ""
@subsection = subsection
@depends_on = [{
"jointpur" => 1,
}]
end
def questions
@questions ||= [
Form::Sales::Questions::Buyer2IncomeKnown.new(nil, nil, self),
Form::Sales::Questions::Buyer2Income.new(nil, nil, self),
]
end
end

16
app/models/form/sales/questions/buyer1_mortgage.rb

@ -0,0 +1,16 @@
class Form::Sales::Questions::Buyer1Mortgage < ::Form::Question
def initialize(id, hsh, page)
super
@id = "inc1mort"
@check_answer_label = "Buyer 1's income used for mortgage application"
@header = "Was buyer 1's income used for a mortgage application"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@page = page
end
ANSWER_OPTIONS = {
"1" => { "value" => "Yes" },
"2" => { "value" => "No" },
}.freeze
end

14
app/models/form/sales/questions/buyer2_income.rb

@ -0,0 +1,14 @@
class Form::Sales::Questions::Buyer2Income < ::Form::Question
def initialize(id, hsh, page)
super
@id = "income2"
@check_answer_label = "Buyer 2’s gross annual income"
@header = "Buyer 2’s gross annual income"
@type = "numeric"
@page = page
@min = 0
@step = 1
@width = 5
@prefix = "£"
end
end

21
app/models/form/sales/questions/buyer2_income_known.rb

@ -0,0 +1,21 @@
class Form::Sales::Questions::Buyer2IncomeKnown < ::Form::Question
def initialize(id, hsh, page)
super
@id = "income2nk"
@check_answer_label = "Buyer 2’s gross annual income"
@header = "Do you know buyer 2’s annual income?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@page = page
@guidance_position = GuidancePosition::BOTTOM
@guidance_partial = "what_counts_as_income_sales"
@conditional_for = {
"income2" => [0],
}
end
ANSWER_OPTIONS = {
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
}.freeze
end

2
app/models/form/sales/sections/finances.rb

@ -6,7 +6,7 @@ class Form::Sales::Sections::Finances < ::Form::Section
@description = ""
@form = form
@subsections = [
Form::Sales::Subsections::IncomeBenefitsAndOutgoings.new(nil, nil, self),
Form::Sales::Subsections::IncomeBenefitsAndSavings.new(nil, nil, self),
]
end
end

15
app/models/form/sales/subsections/income_benefits_and_outgoings.rb

@ -1,15 +0,0 @@
class Form::Sales::Subsections::IncomeBenefitsAndOutgoings < ::Form::Subsection
def initialize(id, hsh, section)
super
@id = "income_benefits_and_outgoings"
@label = "Income, benefits and outgoings"
@section = section
@depends_on = [{ "setup_completed?" => true }]
end
def pages
@pages ||= [
Form::Sales::Pages::Buyer1Income.new(nil, nil, self),
]
end
end

17
app/models/form/sales/subsections/income_benefits_and_savings.rb

@ -0,0 +1,17 @@
class Form::Sales::Subsections::IncomeBenefitsAndSavings < ::Form::Subsection
def initialize(id, hsh, section)
super
@id = "income_benefits_and_savings"
@label = "Income, benefits and savings"
@section = section
@depends_on = [{ "setup_completed?" => true }]
end
def pages
@pages ||= [
Form::Sales::Pages::Buyer1Income.new(nil, nil, self),
Form::Sales::Pages::Buyer1Mortgage.new(nil, nil, self),
Form::Sales::Pages::Buyer2Income.new(nil, nil, self),
]
end
end

2
app/views/locations/deactivate_confirm.html.erb

@ -4,7 +4,7 @@
<% end %>
<h1 class="govuk-heading-l">
<span class="govuk-caption-l"><%= @location.postcode %></span>
This change will affect <%= @location.lettings_logs.count %> logs
This change will affect <%= @affected_logs.count %> logs
</h1>
<%= govuk_warning_text text: I18n.t("warnings.location.deactivate.review_logs") %>
<%= f.hidden_field :confirm, value: true %>

2
app/views/schemes/deactivate_confirm.html.erb

@ -4,7 +4,7 @@
<% end %>
<h1 class="govuk-heading-l">
<span class="govuk-caption-l"><%= @scheme.service_name %></span>
This change will affect <%= @scheme.lettings_logs.count %> logs
This change will affect <%= @affected_logs.count %> logs
</h1>
<%= govuk_warning_text text: I18n.t("warnings.scheme.deactivate.review_logs") %>
<%= f.hidden_field :confirm, value: true %>

7
db/migrate/20221124102329_add_mortgage1_to_sales.rb

@ -0,0 +1,7 @@
class AddMortgage1ToSales < ActiveRecord::Migration[7.0]
def change
change_table :sales_logs, bulk: true do |t|
t.column :inc1mort, :int
end
end
end

6
db/migrate/20221125142847_add_buyer2_to_sales.rb

@ -0,0 +1,6 @@
class AddBuyer2ToSales < ActiveRecord::Migration[7.0]
change_table :sales_logs, bulk: true do |t|
t.column :income2, :int
t.column :income2nk, :int
end
end

11
db/schema.rb

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2022_11_22_130928) do
ActiveRecord::Schema[7.0].define(version: 2022_11_25_142847) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -374,15 +374,18 @@ ActiveRecord::Schema[7.0].define(version: 2022_11_22_130928) do
t.integer "la_known"
t.integer "income1"
t.integer "income1nk"
t.integer "details_known_2"
t.integer "details_known_3"
t.integer "details_known_4"
t.integer "age4"
t.integer "age4_known"
t.integer "age5"
t.integer "age5_known"
t.integer "age6"
t.integer "age6_known"
t.integer "details_known_2"
t.integer "details_known_3"
t.integer "details_known_4"
t.integer "inc1mort"
t.integer "income2"
t.integer "income2nk"
t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id"
t.index ["managing_organisation_id"], name: "index_sales_logs_on_managing_organisation_id"
t.index ["owning_organisation_id"], name: "index_sales_logs_on_owning_organisation_id"

3
spec/factories/sales_log.rb

@ -52,6 +52,9 @@ FactoryBot.define do
age6 { 40 }
income1nk { 0 }
income1 { 10_000 }
inc1mort { 1 }
income2nk { 0 }
income2 { 10_000 }
la_known { "1" }
la { "E09000003" }
end

33
spec/models/form/sales/pages/buyer1_mortgage_spec.rb

@ -0,0 +1,33 @@
require "rails_helper"
RSpec.describe Form::Sales::Pages::Buyer1Mortgage, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection) }
let(:page_id) { nil }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
end
it "has correct questions" do
expect(page.questions.map(&:id)).to eq(%w[inc1mort])
end
it "has the correct id" do
expect(page.id).to eq("buyer_1_mortgage")
end
it "has the correct header" do
expect(page.header).to eq("")
end
it "has the correct description" do
expect(page.description).to eq("")
end
it "has correct depends_on" do
expect(page.depends_on).to be_nil
end
end

33
spec/models/form/sales/pages/buyer2_income_spec.rb

@ -0,0 +1,33 @@
require "rails_helper"
RSpec.describe Form::Sales::Pages::Buyer2Income, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection) }
let(:page_id) { nil }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
end
it "has correct questions" do
expect(page.questions.map(&:id)).to eq(%w[income2nk income2])
end
it "has the correct id" do
expect(page.id).to eq("buyer_2_income")
end
it "has the correct header" do
expect(page.header).to eq("")
end
it "has the correct description" do
expect(page.description).to eq("")
end
it "has correct depends_on" do
expect(page.depends_on).to eq([{ "jointpur" => 1 }])
end
end

40
spec/models/form/sales/questions/buyer1_mortgage_spec.rb

@ -0,0 +1,40 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::Buyer1Mortgage, type: :model do
subject(:question) { described_class.new(question_id, question_definition, page) }
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) }
it "has correct page" do
expect(question.page).to eq(page)
end
it "has the correct id" do
expect(question.id).to eq("inc1mort")
end
it "has the correct header" do
expect(question.header).to eq("Was buyer 1's income used for a mortgage application")
end
it "has the correct check_answer_label" do
expect(question.check_answer_label).to eq("Buyer 1's income used for mortgage application")
end
it "has the correct type" do
expect(question.type).to eq("radio")
end
it "is not marked as derived" do
expect(question.derived?).to be false
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"1" => { "value" => "Yes" },
"2" => { "value" => "No" },
})
end
end

55
spec/models/form/sales/questions/buyer2_income_known_spec.rb

@ -0,0 +1,55 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::Buyer2IncomeKnown, type: :model do
subject(:question) { described_class.new(question_id, question_definition, page) }
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) }
it "has correct page" do
expect(question.page).to eq(page)
end
it "has the correct id" do
expect(question.id).to eq("income2nk")
end
it "has the correct header" do
expect(question.header).to eq("Do you know buyer 2’s annual income?")
end
it "has the correct check_answer_label" do
expect(question.check_answer_label).to eq("Buyer 2’s gross annual income")
end
it "has the correct type" do
expect(question.type).to eq("radio")
end
it "is not marked as derived" do
expect(question.derived?).to be false
end
it "has the correct answer_options" do
expect(question.answer_options).to eq({
"0" => { "value" => "Yes" },
"1" => { "value" => "No" },
})
end
it "has correct conditional for" do
expect(question.conditional_for).to eq({
"income2" => [0],
})
end
it "has the correct guidance_partial" do
expect(question.guidance_partial).to eq("what_counts_as_income_sales")
end
it "has the correct guidance position", :aggregate_failures do
expect(question.bottom_guidance?).to eq(true)
expect(question.top_guidance?).to eq(false)
end
end

53
spec/models/form/sales/questions/buyer2_income_spec.rb

@ -0,0 +1,53 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::Buyer2Income, type: :model do
subject(:question) { described_class.new(question_id, question_definition, page) }
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page) }
it "has correct page" do
expect(question.page).to eq(page)
end
it "has the correct id" do
expect(question.id).to eq("income2")
end
it "has the correct header" do
expect(question.header).to eq("Buyer 2’s gross annual income")
end
it "has the correct check_answer_label" do
expect(question.check_answer_label).to eq("Buyer 2’s gross annual income")
end
it "has the correct type" do
expect(question.type).to eq("numeric")
end
it "is not marked as derived" do
expect(question.derived?).to be false
end
it "has the correct hint" do
expect(question.hint_text).to be_nil
end
it "has correct width" do
expect(question.width).to eq(5)
end
it "has correct step" do
expect(question.step).to eq(1)
end
it "has correct prefix" do
expect(question.prefix).to eq("£")
end
it "has correct min" do
expect(question.min).to eq(0)
end
end

2
spec/models/form/sales/sections/finances_spec.rb

@ -14,7 +14,7 @@ RSpec.describe Form::Sales::Sections::Finances, type: :model do
it "has correct subsections" do
expect(section.subsections.map(&:id)).to eq(
%w[
income_benefits_and_outgoings
income_benefits_and_savings
],
)
end

8
spec/models/form/sales/subsections/income_benefits_and_outgoings_spec.rb → spec/models/form/sales/subsections/income_benefits_and_savings_spec.rb

@ -1,6 +1,6 @@
require "rails_helper"
RSpec.describe Form::Sales::Subsections::IncomeBenefitsAndOutgoings, type: :model do
RSpec.describe Form::Sales::Subsections::IncomeBenefitsAndSavings, type: :model do
subject(:subsection) { described_class.new(subsection_id, subsection_definition, section) }
let(:subsection_id) { nil }
@ -15,16 +15,18 @@ RSpec.describe Form::Sales::Subsections::IncomeBenefitsAndOutgoings, type: :mode
expect(subsection.pages.map(&:id)).to eq(
%w[
buyer_1_income
buyer_1_mortgage
buyer_2_income
],
)
end
it "has the correct id" do
expect(subsection.id).to eq("income_benefits_and_outgoings")
expect(subsection.id).to eq("income_benefits_and_savings")
end
it "has the correct label" do
expect(subsection.label).to eq("Income, benefits and outgoings")
expect(subsection.label).to eq("Income, benefits and savings")
end
it "has correct depends on" do

4
spec/models/form_handler_spec.rb

@ -61,14 +61,14 @@ RSpec.describe FormHandler do
it "is able to load a current sales form" do
form = form_handler.get_form("current_sales")
expect(form).to be_a(Form)
expect(form.pages.count).to eq(44)
expect(form.pages.count).to eq(46)
expect(form.name).to eq("2022_2023_sales")
end
it "is able to load a previous sales form" do
form = form_handler.get_form("previous_sales")
expect(form).to be_a(Form)
expect(form.pages.count).to eq(44)
expect(form.pages.count).to eq(46)
expect(form.name).to eq("2021_2022_sales")
end
end

15
spec/models/scheme_spec.rb

@ -175,4 +175,19 @@ RSpec.describe Scheme, type: :model do
end
end
end
describe "all schemes" do
before do
FactoryBot.create_list(:scheme, 4)
FactoryBot.create_list(:scheme, 3, confirmed: false)
end
it "can sort the schemes by status" do
all_schemes = described_class.all.order(confirmed: :asc, service_name: :asc)
expect(all_schemes.count).to eq(7)
expect(all_schemes[0].status).to eq(:incomplete)
expect(all_schemes[1].status).to eq(:incomplete)
expect(all_schemes[2].status).to eq(:incomplete)
end
end
end

36
spec/requests/locations_controller_spec.rb

@ -1243,11 +1243,13 @@ RSpec.describe LocationsController, type: :request do
let!(:lettings_log) { FactoryBot.create(:lettings_log, :sh, location:, scheme:, startdate:, owning_organisation: user.organisation) }
let(:startdate) { Time.utc(2022, 10, 11) }
let(:add_deactivations) { nil }
let(:setup_locations) { nil }
before do
Timecop.freeze(Time.utc(2022, 10, 10))
sign_in user
add_deactivations
setup_locations
location.save!
patch "/schemes/#{scheme.id}/locations/#{location.id}/new-deactivation", params:
end
@ -1259,16 +1261,33 @@ RSpec.describe LocationsController, type: :request do
context "with default date" do
let(:params) { { location_deactivation_period: { deactivation_date_type: "default", deactivation_date: } } }
context "and affected logs" do
it "redirects to the confirmation page" do
follow_redirect!
expect(response).to have_http_status(:ok)
expect(page).to have_content("This change will affect #{location.lettings_logs.count} logs")
expect(page).to have_content("This change will affect 1 logs")
end
end
context "and no affected logs" do
let(:setup_locations) { location.lettings_logs.update(location: nil) }
it "redirects to the location page and updates the deactivation period" do
follow_redirect!
follow_redirect!
expect(response).to have_http_status(:ok)
expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success")
location.reload
expect(location.location_deactivation_periods.count).to eq(1)
expect(location.location_deactivation_periods.first.deactivation_date).to eq(Time.zone.local(2022, 4, 1))
end
end
end
context "with other date" do
let(:params) { { location_deactivation_period: { deactivation_date_type: "other", "deactivation_date(3i)": "10", "deactivation_date(2i)": "10", "deactivation_date(1i)": "2022" } } }
context "and afected logs" do
it "redirects to the confirmation page" do
follow_redirect!
expect(response).to have_http_status(:ok)
@ -1276,6 +1295,21 @@ RSpec.describe LocationsController, type: :request do
end
end
context "and no affected logs" do
let(:setup_locations) { location.lettings_logs.update(location: nil) }
it "redirects to the location page and updates the deactivation period" do
follow_redirect!
follow_redirect!
expect(response).to have_http_status(:ok)
expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success")
location.reload
expect(location.location_deactivation_periods.count).to eq(1)
expect(location.location_deactivation_periods.first.deactivation_date).to eq(Time.zone.local(2022, 10, 10))
end
end
end
context "when confirming deactivation" do
let(:params) { { deactivation_date:, confirm: true, deactivation_date_type: "other" } }

36
spec/requests/schemes_controller_spec.rb

@ -1772,10 +1772,12 @@ RSpec.describe SchemesController, type: :request do
let(:deactivation_date) { Time.utc(2022, 10, 10) }
let!(:lettings_log) { FactoryBot.create(:lettings_log, :sh, location:, scheme:, startdate:, owning_organisation: user.organisation) }
let(:startdate) { Time.utc(2022, 10, 11) }
let(:setup_schemes) { nil }
before do
Timecop.freeze(Time.utc(2022, 10, 10))
sign_in user
setup_schemes
patch "/schemes/#{scheme.id}/new-deactivation", params:
end
@ -1786,6 +1788,7 @@ RSpec.describe SchemesController, type: :request do
context "with default date" do
let(:params) { { scheme_deactivation_period: { deactivation_date_type: "default", deactivation_date: } } }
context "and affected logs" do
it "redirects to the confirmation page" do
follow_redirect!
expect(response).to have_http_status(:ok)
@ -1793,9 +1796,26 @@ RSpec.describe SchemesController, type: :request do
end
end
context "and no affected logs" do
let(:setup_schemes) { scheme.lettings_logs.update(scheme: nil) }
it "redirects to the location page and updates the deactivation period" do
follow_redirect!
follow_redirect!
follow_redirect!
expect(response).to have_http_status(:ok)
expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success")
scheme.reload
expect(scheme.scheme_deactivation_periods.count).to eq(1)
expect(scheme.scheme_deactivation_periods.first.deactivation_date).to eq(Time.zone.local(2022, 4, 1))
end
end
end
context "with other date" do
let(:params) { { scheme_deactivation_period: { deactivation_date_type: "other", "deactivation_date(3i)": "10", "deactivation_date(2i)": "10", "deactivation_date(1i)": "2022" } } }
context "and affected logs" do
it "redirects to the confirmation page" do
follow_redirect!
expect(response).to have_http_status(:ok)
@ -1803,6 +1823,22 @@ RSpec.describe SchemesController, type: :request do
end
end
context "and no affected logs" do
let(:setup_schemes) { scheme.lettings_logs.update(scheme: nil) }
it "redirects to the location page and updates the deactivation period" do
follow_redirect!
follow_redirect!
follow_redirect!
expect(response).to have_http_status(:ok)
expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success")
scheme.reload
expect(scheme.scheme_deactivation_periods.count).to eq(1)
expect(scheme.scheme_deactivation_periods.first.deactivation_date).to eq(Time.zone.local(2022, 10, 10))
end
end
end
context "when confirming deactivation" do
let(:params) { { deactivation_date:, confirm: true, deactivation_date_type: "other" } }

Loading…
Cancel
Save