From ee14bca6cf7bd77f05956bd9b7c27730f1e0bb69 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Thu, 25 May 2023 17:08:55 +0100 Subject: [PATCH] CLDC-2364 Display guidance text on net income question (#1668) * Make sure that the guidance text is displayed on net income question * add test * Add missing guidance to earnings --- app/models/form/lettings/questions/earnings.rb | 1 + app/models/form/lettings/questions/net_income_known.rb | 1 + .../form/lettings/questions/net_income_known_spec.rb | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/app/models/form/lettings/questions/earnings.rb b/app/models/form/lettings/questions/earnings.rb index fdf702740..4169547c1 100644 --- a/app/models/form/lettings/questions/earnings.rb +++ b/app/models/form/lettings/questions/earnings.rb @@ -9,6 +9,7 @@ class Form::Lettings::Questions::Earnings < ::Form::Question @check_answers_card_number = 0 @min = 0 @guidance_partial = "what_counts_as_income" + @guidance_position = GuidancePosition::TOP @hint_text = "" @step = 0.01 @prefix = "£" diff --git a/app/models/form/lettings/questions/net_income_known.rb b/app/models/form/lettings/questions/net_income_known.rb index 226569b9e..4c232a85d 100644 --- a/app/models/form/lettings/questions/net_income_known.rb +++ b/app/models/form/lettings/questions/net_income_known.rb @@ -7,6 +7,7 @@ class Form::Lettings::Questions::NetIncomeKnown < ::Form::Question @type = "radio" @check_answers_card_number = 0 @guidance_partial = "what_counts_as_income" + @guidance_position = GuidancePosition::TOP @hint_text = "" @answer_options = ANSWER_OPTIONS @question_number = 86 diff --git a/spec/models/form/lettings/questions/net_income_known_spec.rb b/spec/models/form/lettings/questions/net_income_known_spec.rb index 4a0925fa4..80ea412ba 100644 --- a/spec/models/form/lettings/questions/net_income_known_spec.rb +++ b/spec/models/form/lettings/questions/net_income_known_spec.rb @@ -14,4 +14,11 @@ RSpec.describe Form::Lettings::Questions::NetIncomeKnown do expect(question.type).to eql("radio") end end + + describe "#partial guidance" do + it "is at the top" do + expect(question.top_guidance?).to eq(true) + expect(question.bottom_guidance?).to eq(false) + end + end end