Skip to content

Commit

Permalink
Change min age for kids authorization from 10 to 8
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi committed Feb 13, 2024
1 parent e05f415 commit 0636299
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/services/census_kids_authorization_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# to verify the citizen's residence.
class CensusKidsAuthorizationHandler < CensusAuthorizationHandler
def age_limit
errors.add(:date_of_birth, I18n.t("census_kids_authorization_handler.age_under", min_age: 10)) unless age && age >= 10
errors.add(:date_of_birth, I18n.t("census_kids_authorization_handler.age_under", min_age: 8)) unless age && age >= 8
end
end
2 changes: 1 addition & 1 deletion app/views/census_kids_authorization/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</div>

<div class="field date">
<%= form.date_select :date_of_birth, start_year: 20.years.ago.year, end_year: 10.years.ago.year, default: 12.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %>
<%= form.date_select :date_of_birth, start_year: 20.years.ago.year, end_year: 8.years.ago.year, default: 12.years.ago, prompt: { day: t(".date_select.day"), month: t(".date_select.month"), year: t(".date_select.year") } %>
</div>

<div class="field">
Expand Down
4 changes: 2 additions & 2 deletions config/locales/ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ ca:
gender: Sexe
postal_code: Codi postal
scope: Districte
name: El padró (majors de 10 anys)
name: El padró (majors de 8 anys)
budgets:
projects:
budget_confirm:
Expand Down Expand Up @@ -249,7 +249,7 @@ ca:
actions:
census16_authorization_handler: Verifica't amb el padró (16+)
census_authorization_handler: Verifica't amb el padró
census_kids_authorization_handler: Verifica't amb el padró (10+)
census_kids_authorization_handler: Verifica't amb el padró (8+)
census_sms_authorization_handler: Verifica't amb el padró i el teu mòbil
valid_auth: Valid auth
layouts:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ es:
actions:
census16_authorization_handler: Verifícate con el padrón (16+)
census_authorization_handler: Verifícate con el padrón
census_kids_authorization_handler: Verifícate con el padrón (10+)
census_kids_authorization_handler: Verifícate con el padrón (8+)
layouts:
decidim:
initiative_header_steps:
Expand Down
8 changes: 4 additions & 4 deletions spec/system/census_kids_authorization_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def fill_in_authorization_form
end

click_link "Autoritzacions"
click_link "El padró (majors de 10 anys)"
click_link "El padró (majors de 8 anys)"

fill_in_authorization_form
click_button "Enviar"
Expand All @@ -62,8 +62,8 @@ def fill_in_authorization_form
visit decidim_verifications.authorizations_path

within ".authorizations-list" do
expect(page).to have_content("El padró (majors de 10 anys)")
expect(page).not_to have_link("El padró (majors de 10 anys)")
expect(page).to have_content("El padró (majors de 8 anys)")
expect(page).not_to have_link("El padró (majors de 8 anys)")
end
end

Expand All @@ -78,7 +78,7 @@ def fill_in_authorization_form
visit decidim_verifications.authorizations_path

within ".authorizations-list" do
expect(page).to have_content("El padró (majors de 10 anys)")
expect(page).to have_content("El padró (majors de 8 anys)")
expect(page).to have_content(I18n.l(authorization.granted_at, format: :long, locale: :ca))
end
end
Expand Down

0 comments on commit 0636299

Please sign in to comment.