Browse Source

Change about_price_social_housing to about_price_shared_ownership and display it in all shared ownership cases

pull/1135/head
Kat 4 years ago
parent
commit
a440fe1e60
  1. 7
      app/models/form/sales/pages/about_price_shared_ownership.rb
  2. 3
      app/models/form/sales/subsections/shared_ownership_scheme.rb
  3. 8
      spec/models/form/sales/pages/about_price_shared_ownership_spec.rb
  4. 3
      spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb

7
app/models/form/sales/pages/about_price_social_housing.rb → app/models/form/sales/pages/about_price_shared_ownership.rb

@ -1,13 +1,10 @@
class Form::Sales::Pages::AboutPriceSocialHousing < ::Form::Page
class Form::Sales::Pages::AboutPriceSharedOwnership < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "about_price_social_housing"
@id = "about_price_shared_ownership"
@header = "About the price of the property"
@description = ""
@subsection = subsection
@depends_on = [{
"soctenant" => 1,
}]
end
def questions

3
app/models/form/sales/subsections/shared_ownership_scheme.rb

@ -16,8 +16,7 @@ class Form::Sales::Subsections::SharedOwnershipScheme < ::Form::Subsection
Form::Sales::Pages::LaNominations.new(nil, nil, self),
Form::Sales::Pages::BuyerPrevious.new(nil, nil, self),
Form::Sales::Pages::PreviousBedrooms.new(nil, nil, self),
Form::Sales::Pages::AboutPrice.new(nil, nil, self),
Form::Sales::Pages::AboutPriceSocialHousing.new(nil, nil, self),
Form::Sales::Pages::AboutPriceSharedOwnership.new(nil, nil, self),
Form::Sales::Pages::MortgageAmount.new("mortgage_amount_shared_ownership", nil, self),
Form::Sales::Pages::AboutDeposit.new("about_deposit_shared_ownership", nil, self),
Form::Sales::Pages::MonthlyRent.new(nil, nil, self),

8
spec/models/form/sales/pages/about_price_social_housing_spec.rb → spec/models/form/sales/pages/about_price_shared_ownership_spec.rb

@ -1,6 +1,6 @@
require "rails_helper"
RSpec.describe Form::Sales::Pages::AboutPriceSocialHousing, type: :model do
RSpec.describe Form::Sales::Pages::AboutPriceSharedOwnership, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection) }
let(:page_id) { nil }
@ -16,7 +16,7 @@ RSpec.describe Form::Sales::Pages::AboutPriceSocialHousing, type: :model do
end
it "has the correct id" do
expect(page.id).to eq("about_price_social_housing")
expect(page.id).to eq("about_price_shared_ownership")
end
it "has the correct header" do
@ -28,8 +28,6 @@ RSpec.describe Form::Sales::Pages::AboutPriceSocialHousing, type: :model do
end
it "has correct depends_on" do
expect(page.depends_on).to eq([{
"soctenant" => 1,
}])
expect(page.depends_on).to be_nil
end
end

3
spec/models/form/sales/subsections/shared_ownership_scheme_spec.rb

@ -21,8 +21,7 @@ RSpec.describe Form::Sales::Subsections::SharedOwnershipScheme, type: :model do
la_nominations
buyer_previous
previous_bedrooms
about_price
about_price_social_housing
about_price_shared_ownership
mortgage_amount_shared_ownership
about_deposit_shared_ownership
monthly_rent

Loading…
Cancel
Save