From 8e1a774dce5c0ae2168d26dc0be2efd81b3dcb27 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Wed, 18 May 2022 15:50:28 +0100 Subject: [PATCH] Update gender content --- app/models/case_log.rb | 4 ++-- spec/models/case_log_spec.rb | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/models/case_log.rb b/app/models/case_log.rb index 6796be006..a03f377fd 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -409,9 +409,9 @@ class CaseLog < ApplicationRecord return unless gender if %w[M X].include?(gender) - "men and non-binary people" + "male and non-binary people" elsif gender == "F" - "women" + "females" end end diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index 005e8c057..10056506b 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -1955,6 +1955,10 @@ RSpec.describe CaseLog do it "returns the expected retirement age" do expect(case_log.retirement_age_for_person_1).to eq(67) end + + it "returns the expected plural" do + expect(case_log.plural_gender_for_person_1).to eq("male and non-binary people") + end end context "when a person gender is Female" do @@ -1963,6 +1967,10 @@ RSpec.describe CaseLog do it "returns the expected retirement age" do expect(case_log.retirement_age_for_person_2).to eq(60) end + + it "returns the expected plural" do + expect(case_log.plural_gender_for_person_2).to eq("females") + end end context "when a person gender is Non-Binary" do @@ -1971,6 +1979,10 @@ RSpec.describe CaseLog do it "returns the expected retirement age" do expect(case_log.retirement_age_for_person_3).to eq(67) end + + it "returns the expected plural" do + expect(case_log.plural_gender_for_person_3).to eq("male and non-binary people") + end end context "when the person gender is not set" do @@ -1979,6 +1991,10 @@ RSpec.describe CaseLog do it "returns nil" do expect(case_log.retirement_age_for_person_3).to be_nil end + + it "returns the expected plural" do + expect(case_log.plural_gender_for_person_3).to be_nil + end end end end