Browse Source

Update gender content

pull/586/head
baarkerlounger 3 years ago
parent
commit
8e1a774dce
  1. 4
      app/models/case_log.rb
  2. 16
      spec/models/case_log_spec.rb

4
app/models/case_log.rb

@ -409,9 +409,9 @@ class CaseLog < ApplicationRecord
return unless gender return unless gender
if %w[M X].include?(gender) if %w[M X].include?(gender)
"men and non-binary people" "male and non-binary people"
elsif gender == "F" elsif gender == "F"
"women" "females"
end end
end end

16
spec/models/case_log_spec.rb

@ -1955,6 +1955,10 @@ RSpec.describe CaseLog do
it "returns the expected retirement age" do it "returns the expected retirement age" do
expect(case_log.retirement_age_for_person_1).to eq(67) expect(case_log.retirement_age_for_person_1).to eq(67)
end end
it "returns the expected plural" do
expect(case_log.plural_gender_for_person_1).to eq("male and non-binary people")
end
end end
context "when a person gender is Female" do context "when a person gender is Female" do
@ -1963,6 +1967,10 @@ RSpec.describe CaseLog do
it "returns the expected retirement age" do it "returns the expected retirement age" do
expect(case_log.retirement_age_for_person_2).to eq(60) expect(case_log.retirement_age_for_person_2).to eq(60)
end end
it "returns the expected plural" do
expect(case_log.plural_gender_for_person_2).to eq("females")
end
end end
context "when a person gender is Non-Binary" do context "when a person gender is Non-Binary" do
@ -1971,6 +1979,10 @@ RSpec.describe CaseLog do
it "returns the expected retirement age" do it "returns the expected retirement age" do
expect(case_log.retirement_age_for_person_3).to eq(67) expect(case_log.retirement_age_for_person_3).to eq(67)
end end
it "returns the expected plural" do
expect(case_log.plural_gender_for_person_3).to eq("male and non-binary people")
end
end end
context "when the person gender is not set" do context "when the person gender is not set" do
@ -1979,6 +1991,10 @@ RSpec.describe CaseLog do
it "returns nil" do it "returns nil" do
expect(case_log.retirement_age_for_person_3).to be_nil expect(case_log.retirement_age_for_person_3).to be_nil
end end
it "returns the expected plural" do
expect(case_log.plural_gender_for_person_3).to be_nil
end
end end
end end
end end

Loading…
Cancel
Save