Browse Source

some copy changes and alterations of readability after code review

pull/1354/head
Arthur Campbell 3 years ago
parent
commit
78724a14c0
  1. 2
      app/models/form/sales/pages/buyer2_previous_housing_situation.rb
  2. 4
      app/models/form/sales/questions/buyer2_living_in.rb
  3. 2
      app/models/sales_log.rb
  4. 2
      spec/models/form/sales/pages/buyer2_previous_housing_situation_spec.rb
  5. 12
      spec/models/form/sales/questions/buyer2_living_in_spec.rb

2
app/models/form/sales/pages/buyer2_previous_housing_situation.rb

@ -2,7 +2,7 @@ class Form::Sales::Pages::Buyer2PreviousHousingSituation < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "buyer_2_previous_housing_situation"
@depends_on = [{ "buyer_two_not_already_living_in?" => true }]
@depends_on = [{ "buyer_two_not_already_living_in_property?" => true }]
end
def questions

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

@ -2,8 +2,8 @@ class Form::Sales::Questions::Buyer2LivingIn < ::Form::Question
def initialize(id, hsh, page)
super
@id = "buy2living"
@check_answer_label = "All buyers living at the same address"
@header = "Were all buyers living at the same address at the time of purchase?"
@check_answer_label = "Buyer 2 living at the same address"
@header = "At the time of purchase, was buyer 2 living at the same address as buyer 1?"
@type = "radio"
@hint_text = ""
@answer_options = ANSWER_OPTIONS

2
app/models/sales_log.rb

@ -155,7 +155,7 @@ class SalesLog < Log
buy2livein == 1
end
def buyer_two_not_already_living_in?
def buyer_two_not_already_living_in_property?
buy2living == 2
end

2
spec/models/form/sales/pages/buyer2_previous_housing_situation_spec.rb

@ -26,6 +26,6 @@ RSpec.describe Form::Sales::Pages::Buyer2PreviousHousingSituation, type: :model
end
it "has correct depends_on" do
expect(page.depends_on).to eq([{ "buyer_two_not_already_living_in?" => true }])
expect(page.depends_on).to eq([{ "buyer_two_not_already_living_in_property?" => true }])
end
end

12
spec/models/form/sales/questions/buyer2_living_in_spec.rb

@ -6,23 +6,23 @@ RSpec.describe Form::Sales::Questions::Buyer2LivingIn, type: :model do
let(:page) { instance_double(Form::Page) }
it "has correct page" do
expect(question.page).to eq(page)
expect(question.page).to eq page
end
it "has the correct id" do
expect(question.id).to eq("buy2living")
expect(question.id).to eq "buy2living"
end
it "has the correct header" do
expect(question.header).to eq("Were all buyers living at the same address at the time of purchase?")
expect(question.header).to eq "At the time of purchase, was buyer 2 living at the same address as buyer 1?"
end
it "has the correct check_answer_label" do
expect(question.check_answer_label).to eq("All buyers living at the same address")
expect(question.check_answer_label).to eq "Buyer 2 living at the same address"
end
it "has the correct type" do
expect(question.type).to eq("radio")
expect(question.type).to eq "radio"
end
it "is not marked as derived" do
@ -30,7 +30,7 @@ RSpec.describe Form::Sales::Questions::Buyer2LivingIn, type: :model do
end
it "has the correct hint_text" do
expect(question.hint_text).to eq("")
expect(question.hint_text).to eq ""
end
it "has the correct answer_options" do

Loading…
Cancel
Save