Browse Source

CLDC-4141: linting

pull/3156/head
Nat Dean-Lewis 3 weeks ago
parent
commit
45d8f95487
  1. 2
      app/models/form/lettings/pages/person_sex_registered_at_birth.rb
  2. 10
      app/models/form/lettings/questions/person_sex_registered_at_birth.rb
  3. 2
      app/services/exports/lettings_log_export_service.rb
  4. 14
      spec/models/form/lettings/pages/person_sex_registered_at_birth_spec.rb
  5. 8
      spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb

2
app/models/form/lettings/pages/person_sex_registered_at_birth.rb

@ -6,7 +6,7 @@ class Form::Lettings::Pages::PersonSexRegisteredAtBirth < ::Form::Page
@id = "person_#{person_index}_sex_registered_at_birth" @id = "person_#{person_index}_sex_registered_at_birth"
@person_index = person_index @person_index = person_index
@depends_on = [ @depends_on = [
{ "details_known_#{person_index}" => 1 }, { "details_known_#{person_index}" => 0 },
] ]
end end

10
app/models/form/lettings/questions/person_sex_registered_at_birth.rb

@ -6,11 +6,11 @@ class Form::Lettings::Questions::PersonSexRegisteredAtBirth < ::Form::Question
@type = "radio" @type = "radio"
@check_answers_card_number = person_index @check_answers_card_number = person_index
@inferred_check_answers_value = [{ @inferred_check_answers_value = [{
"condition" => { "condition" => {
id => "R", id => "R",
}, },
"value" => "Person prefers not to say", "value" => "Person prefers not to say",
}] }]
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

2
app/services/exports/lettings_log_export_service.rb

@ -183,7 +183,7 @@ module Exports
included_fields.merge(PRE_2024_EXPORT_FIELDS) included_fields.merge(PRE_2024_EXPORT_FIELDS)
end end
if !lettings_log.form.start_year_2025_or_later? unless lettings_log.form.start_year_2025_or_later?
included_fields.merge(PRE_2025_EXPORT_FIELDS) included_fields.merge(PRE_2025_EXPORT_FIELDS)
end end

14
spec/models/form/lettings/pages/person_sex_registered_at_birth_spec.rb

@ -30,7 +30,7 @@ RSpec.describe Form::Lettings::Pages::PersonSexRegisteredAtBirth, type: :model d
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([{ "details_known_2" => 1 }]) expect(page.depends_on).to eq([{ "details_known_2" => 0 }])
end end
end end
@ -47,7 +47,7 @@ RSpec.describe Form::Lettings::Pages::PersonSexRegisteredAtBirth, type: :model d
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([{ "details_known_3" => 1 }]) expect(page.depends_on).to eq([{ "details_known_3" => 0 }])
end end
end end
@ -64,7 +64,7 @@ RSpec.describe Form::Lettings::Pages::PersonSexRegisteredAtBirth, type: :model d
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([{ "details_known_4" => 1 }]) expect(page.depends_on).to eq([{ "details_known_4" => 0 }])
end end
end end
@ -81,7 +81,7 @@ RSpec.describe Form::Lettings::Pages::PersonSexRegisteredAtBirth, type: :model d
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([{ "details_known_5" => 1 }]) expect(page.depends_on).to eq([{ "details_known_5" => 0 }])
end end
end end
@ -98,7 +98,7 @@ RSpec.describe Form::Lettings::Pages::PersonSexRegisteredAtBirth, type: :model d
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([{ "details_known_6" => 1 }]) expect(page.depends_on).to eq([{ "details_known_6" => 0 }])
end end
end end
@ -115,7 +115,7 @@ RSpec.describe Form::Lettings::Pages::PersonSexRegisteredAtBirth, type: :model d
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([{ "details_known_7" => 1 }]) expect(page.depends_on).to eq([{ "details_known_7" => 0 }])
end end
end end
@ -132,7 +132,7 @@ RSpec.describe Form::Lettings::Pages::PersonSexRegisteredAtBirth, type: :model d
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq([{ "details_known_8" => 1 }]) expect(page.depends_on).to eq([{ "details_known_8" => 0 }])
end end
end end
end end

8
spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb

@ -145,8 +145,8 @@ RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :mod
it "has the correct inferred_check_answers_value" do it "has the correct inferred_check_answers_value" do
expect(question.inferred_check_answers_value).to eq([ expect(question.inferred_check_answers_value).to eq([
{ "condition" => { "sexrab7" => "R" }, "value" => "Person prefers not to say" }, { "condition" => { "sexrab7" => "R" }, "value" => "Person prefers not to say" },
]) ])
end end
end end
@ -164,8 +164,8 @@ RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :mod
it "has the correct inferred_check_answers_value" do it "has the correct inferred_check_answers_value" do
expect(question.inferred_check_answers_value).to eq([ expect(question.inferred_check_answers_value).to eq([
{ "condition" => { "sexrab8" => "R" }, "value" => "Person prefers not to say" }, { "condition" => { "sexrab8" => "R" }, "value" => "Person prefers not to say" },
]) ])
end end
end end
end end

Loading…
Cancel
Save