Browse Source

Remove redundant `disable_clearing_if_not_routed_or_dynamic_answer_options`

pull/3152/head
oscar-richardson-softwire 3 weeks ago
parent
commit
8dd74017ed
  1. 1
      app/models/form/lettings/questions/person_partner.rb
  2. 16
      spec/models/form/lettings/questions/person_partner_spec.rb

1
app/models/form/lettings/questions/person_partner.rb

@ -7,7 +7,6 @@ class Form::Lettings::Questions::PersonPartner < ::Form::Question
@answer_options = answer_options @answer_options = answer_options
@person_index = person_index @person_index = person_index
@question_number = question_number @question_number = question_number
@disable_clearing_if_not_routed_or_dynamic_answer_options = form.start_year_2026_or_later?
end end
def answer_options def answer_options

16
spec/models/form/lettings/questions/person_partner_spec.rb

@ -47,22 +47,6 @@ RSpec.describe Form::Lettings::Questions::PersonPartner, type: :model do
expect(question.hidden_in_check_answers).to be_nil expect(question.hidden_in_check_answers).to be_nil
end end
context "and in 2025", metadata: { year: 25 } do
let(:year) { 2025 }
it "has the correct disable_clearing_if_not_routed_or_dynamic_answer_options value" do
expect(question.disable_clearing_if_not_routed_or_dynamic_answer_options).to eq(false)
end
end
context "and in 2026", metadata: { year: 26 } do
let(:year) { 2026 }
it "has the correct disable_clearing_if_not_routed_or_dynamic_answer_options value" do
expect(question.disable_clearing_if_not_routed_or_dynamic_answer_options).to eq(true)
end
end
context "with person 2" do context "with person 2" do
it "has the correct id" do it "has the correct id" do
expect(question.id).to eq("relat2") expect(question.id).to eq("relat2")

Loading…
Cancel
Save