Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change applicant minimum age from 22 to 21 #268

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/steps/personal_details_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ def minimum_age
return unless date_of_birth.present?
# rubocop:enable Rails/Blank

errors.add(:date_of_birth, :below_min_age) if date_of_birth > MIN_AGE.years.ago.to_date
errors.add(:date_of_birth, :below_min_age) unless date_of_birth <= MIN_AGE.years.ago.to_date
end

MAX_AGE = 80
MIN_AGE = 22
MIN_AGE = 21
private_constant :MAX_AGE, :MIN_AGE
end
2 changes: 1 addition & 1 deletion config/locales/steps.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ en:
blank: Enter your date of birth
not_in_future: Date of birth cannot be in the future
over_max_age: Age must be below 80
below_min_age: Age must be above 22
below_min_age: Age must be above 21
sex:
blank: Enter your sex
inclusion: Enter your sex
Expand Down
4 changes: 2 additions & 2 deletions spec/steps/personal_details_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
describe "date_of_birth minimum age" do
let(:form) { build(:form, date_of_birth: age) }
let(:error) { step.errors.messages_for(:date_of_birth) }
let(:minimum_age) { 22 }
let(:minimum_age) { 21 }

before { step.valid? }

Expand Down Expand Up @@ -189,7 +189,7 @@

it "has MIN_AGE set to 22" do
min_age = described_class.send(:const_get, :MIN_AGE)
expect(min_age).to eq(22)
expect(min_age).to eq(21)
end
end

Expand Down