diff --git a/app/models/form/lettings/questions/max_rent_value_check.rb b/app/models/form/lettings/questions/max_rent_value_check.rb index 1b70c92dc..6936e9e36 100644 --- a/app/models/form/lettings/questions/max_rent_value_check.rb +++ b/app/models/form/lettings/questions/max_rent_value_check.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::MaxRentValueCheck < ::Form::Question @check_answer_label = "Total rent confirmation" @header = "Are you sure this is correct?" @type = "interruption_screen" - @hint_text = "This is higher than we would expect. Check:" + @hint_text = I18n.t("soft_validations.rent.hint_text", higher_or_lower: "higher") @check_answers_card_number = check_answers_card_number @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } diff --git a/app/models/form/lettings/questions/min_rent_value_check.rb b/app/models/form/lettings/questions/min_rent_value_check.rb index 0853dd5c1..ad4111c61 100644 --- a/app/models/form/lettings/questions/min_rent_value_check.rb +++ b/app/models/form/lettings/questions/min_rent_value_check.rb @@ -5,14 +5,11 @@ class Form::Lettings::Questions::MinRentValueCheck < ::Form::Question @check_answer_label = "Total rent confirmation" @header = "Are you sure this is correct?" @type = "interruption_screen" - @hint_text = I18n.t("soft_validations.rent.soft_min_hint_text") - # @hint_text = "This is lower than we would expect. Check:" + @hint_text = I18n.t("soft_validations.rent.hint_text", higher_or_lower: "lower") @check_answers_card_number = check_answers_card_number @answer_options = ANSWER_OPTIONS @hidden_in_check_answers = { "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] } end - - ANSWER_OPTIONS = { "0" => { "value" => "Yes" }, "1" => { "value" => "No" } }.freeze end diff --git a/spec/models/form/lettings/questions/max_rent_value_check_spec.rb b/spec/models/form/lettings/questions/max_rent_value_check_spec.rb index e69de29bb..5ef200b8a 100644 --- a/spec/models/form/lettings/questions/max_rent_value_check_spec.rb +++ b/spec/models/form/lettings/questions/max_rent_value_check_spec.rb @@ -0,0 +1,44 @@ +require "rails_helper" + +RSpec.describe Form::Lettings::Questions::MaxRentValueCheck, type: :model do + subject(:question) { described_class.new(nil, question_definition, page, check_answers_card_number:) } + + let(:question_definition) { nil } + let(:check_answers_card_number) { nil } + let(:page) { instance_double(Form::Page) } + + it "has correct page" do + expect(question.page).to eq(page) + end + + it "has the correct id" do + expect(question.id).to eq("rent_value_check") + end + + it "has the correct header" do + expect(question.header).to eq("Are you sure this is correct?") + end + + it "has the correct check_answer_label" do + expect(question.check_answer_label).to eq("Total rent confirmation") + end + + it "has the correct type" do + expect(question.type).to eq("interruption_screen") + end + + it "has the correct hint" do + expect(question.hint_text).to eq("This is higher than we would expect. Check:") + end + + it "has the correct answer_options" do + expect(question.answer_options).to eq({ + "0" => { "value" => "Yes" }, + "1" => { "value" => "No" }, + }) + end + + it "has the correct hidden_in_check_answers" do + expect(question.hidden_in_check_answers).to eq({ "depends_on" => [{ "rent_value_check" => 0 }, { "rent_value_check" => 1 }] }) + end +end diff --git a/spec/models/form/lettings/questions/min_rent_value_check_spec.rb b/spec/models/form/lettings/questions/min_rent_value_check_spec.rb index 9fbed2746..dc836a17d 100644 --- a/spec/models/form/lettings/questions/min_rent_value_check_spec.rb +++ b/spec/models/form/lettings/questions/min_rent_value_check_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -RSpec.describe Form::Lettings::Questions::MaxRentValueCheck, type: :model do +RSpec.describe Form::Lettings::Questions::MinRentValueCheck, type: :model do subject(:question) { described_class.new(nil, question_definition, page, check_answers_card_number:) } let(:question_definition) { nil } @@ -28,14 +28,14 @@ RSpec.describe Form::Lettings::Questions::MaxRentValueCheck, type: :model do end it "has the correct hint" do - expect(question.hint_text).to eq("This is higher than we would expect. Check:") + expect(question.hint_text).to eq("This is lower than we would expect. Check:") end it "has the correct answer_options" do expect(question.answer_options).to eq({ - "0" => { "value" => "Yes" }, - "1" => { "value" => "No" }, - }) + "0" => { "value" => "Yes" }, + "1" => { "value" => "No" }, + }) end it "has the correct hidden_in_check_answers" do