Browse Source

Extract town question to a separate row in CYA

CLDC-2390-town-not-given
Kat 2 years ago
parent
commit
0b1202b7ad
  1. 1
      app/models/form/lettings/questions/address_line1.rb
  2. 4
      app/models/form/lettings/questions/town_or_city.rb
  3. 1
      app/models/form/sales/questions/address_line1.rb
  4. 4
      app/models/form/sales/questions/town_or_city.rb
  5. 4
      spec/models/form/lettings/questions/town_or_city_spec.rb
  6. 4
      spec/models/form/sales/questions/town_or_city_spec.rb

1
app/models/form/lettings/questions/address_line1.rb

@ -15,7 +15,6 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question
log.address_line1,
log.address_line2,
log.postcode_full,
log.town_or_city,
log.county,
].select(&:present?).join("\n")
end

4
app/models/form/lettings/questions/town_or_city.rb

@ -7,8 +7,4 @@ class Form::Lettings::Questions::TownOrCity < ::Form::Question
@plain_label = true
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end
def hidden_in_check_answers?(_log = nil, _current_user = nil)
true
end
end

1
app/models/form/sales/questions/address_line1.rb

@ -15,7 +15,6 @@ class Form::Sales::Questions::AddressLine1 < ::Form::Question
log.address_line1,
log.address_line2,
log.postcode_full,
log.town_or_city,
log.county,
].select(&:present?).join("\n")
end

4
app/models/form/sales/questions/town_or_city.rb

@ -7,8 +7,4 @@ class Form::Sales::Questions::TownOrCity < ::Form::Question
@plain_label = true
@disable_clearing_if_not_routed_or_dynamic_answer_options = true
end
def hidden_in_check_answers?(_log = nil, _current_user = nil)
true
end
end

4
spec/models/form/lettings/questions/town_or_city_spec.rb

@ -42,8 +42,4 @@ RSpec.describe Form::Lettings::Questions::TownOrCity, type: :model do
it "has the correct check_answers_card_number" do
expect(question.check_answers_card_number).to be_nil
end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers?).to eq(true)
end
end

4
spec/models/form/sales/questions/town_or_city_spec.rb

@ -42,8 +42,4 @@ RSpec.describe Form::Sales::Questions::TownOrCity, type: :model do
it "has the correct check_answers_card_number" do
expect(question.check_answers_card_number).to be_nil
end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers?).to eq(true)
end
end

Loading…
Cancel
Save