Browse Source

feat: respond to PR comments (#1138)

* feat: respond to PR comments

* test: update tests
chloe-1
natdeanlewissoftwire 2 years ago committed by GitHub
parent
commit
7e950564ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/models/form/sales/pages/privacy_notice.rb
  2. 2
      app/models/form/sales/questions/buyer_interview.rb
  3. 1
      spec/factories/sales_log.rb
  4. 2
      spec/models/form/sales/pages/privacy_notice_spec.rb
  5. 2
      spec/models/form/sales/questions/buyer_interview_spec.rb

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

@ -6,7 +6,7 @@ class Form::Sales::Pages::PrivacyNotice < ::Form::Page
@description = "" @description = ""
@subsection = subsection @subsection = subsection
@depends_on = [{ @depends_on = [{
"noint" => 1, "noint" => 2,
}] }]
end end

2
app/models/form/sales/questions/buyer_interview.rb

@ -11,7 +11,7 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {
"1" => { "value" => "No" },
"2" => { "value" => "Yes" }, "2" => { "value" => "Yes" },
"1" => { "value" => "No" },
}.freeze }.freeze
end end

1
spec/factories/sales_log.rb

@ -21,6 +21,7 @@ FactoryBot.define do
beds { 2 } beds { 2 }
jointmore { 1 } jointmore { 1 }
noint { 2 } noint { 2 }
privacynotice { 1 }
age1_known { 0 } age1_known { 0 }
age1 { 30 } age1 { 30 }
sex1 { "X" } sex1 { "X" }

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

@ -28,6 +28,6 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([{ "noint" => 1 }]) expect(page.depends_on).to eq([{ "noint" => 2 }])
end end
end end

2
spec/models/form/sales/questions/buyer_interview_spec.rb

@ -37,8 +37,8 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do
it "has the correct answer_options" do it "has the correct answer_options" do
expect(question.answer_options).to eq({ expect(question.answer_options).to eq({
"1" => { "value" => "No" },
"2" => { "value" => "Yes" }, "2" => { "value" => "Yes" },
"1" => { "value" => "No" },
}) })
end end
end end

Loading…
Cancel
Save