Browse Source

CLDC-2545: linting

CLDC-2454-add-q90-based-on-q78
Aaron Spencer 2 years ago
parent
commit
a9596a4626
  1. 2
      app/models/form/sales/questions/mortgageused.rb
  2. 14
      spec/models/form/sales/questions/mortgageused_spec.rb

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

@ -18,7 +18,7 @@ class Form::Sales::Questions::Mortgageused < ::Form::Question
def displayed_answer_options(log, _user = nil) def displayed_answer_options(log, _user = nil)
if log.stairowned == 100 && if log.stairowned == 100 &&
ANSWER_OPTIONS ANSWER_OPTIONS
else else
{ {
"1" => { "value" => "Yes" }, "1" => { "value" => "Yes" },

14
spec/models/form/sales/questions/mortgageused_spec.rb

@ -50,22 +50,24 @@ RSpec.describe Form::Sales::Questions::Mortgageused, type: :model do
context "staircase owned percentage is 100%" do context "staircase owned percentage is 100%" do
let(:log) { build(:sales_log, stairowned: 100) } let(:log) { build(:sales_log, stairowned: 100) }
it "show's the don't know option" do it "show's the don't know option" do
expect(question.displayed_answer_options(log)).to eq({ expect(question.displayed_answer_options(log)).to eq({
"1" => { "value" => "Yes" }, "1" => { "value" => "Yes" },
"2" => { "value" => "No" }, "2" => { "value" => "No" },
"3" => { "value" => "Don’t know" } "3" => { "value" => "Don’t know" },
}) })
end end
end end
context "staircase owned percentage is less than 100%" do context "staircase owned percentage is less than 100%" do
let(:log) { build(:sales_log, stairowned: 99) } let(:log) { build(:sales_log, stairowned: 99) }
it "show's the don't know option" do it "show's the don't know option" do
expect(question.displayed_answer_options(log)).to eq({ expect(question.displayed_answer_options(log)).to eq({
"1" => { "value" => "Yes" }, "1" => { "value" => "Yes" },
"2" => { "value" => "No" }, "2" => { "value" => "No" },
}) })
end end
end end
end end

Loading…
Cancel
Save