diff --git a/app/services/census_kids_authorization_handler.rb b/app/services/census_kids_authorization_handler.rb index 0b83f0a29..d436f583e 100644 --- a/app/services/census_kids_authorization_handler.rb +++ b/app/services/census_kids_authorization_handler.rb @@ -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 diff --git a/app/views/census_kids_authorization/_form.html.erb b/app/views/census_kids_authorization/_form.html.erb index 21da521e0..9eb84b886 100644 --- a/app/views/census_kids_authorization/_form.html.erb +++ b/app/views/census_kids_authorization/_form.html.erb @@ -7,7 +7,7 @@
- <%= 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") } %>
diff --git a/config/locales/ca.yml b/config/locales/ca.yml index ad01e21f1..909e1f008 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -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: @@ -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: diff --git a/config/locales/es.yml b/config/locales/es.yml index 6315e3791..63e1c3212 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -160,7 +160,7 @@ es: gender: Sexo postal_code: Código postal scope_id: Distrito - name: El padrón (mayores de 10 años) + name: El padrón (mayores de 8 años) budgets: projects: budget_confirm: @@ -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: diff --git a/spec/services/census_kids_authorization_handler_spec.rb b/spec/services/census_kids_authorization_handler_spec.rb index fcfbbcab3..05be03eed 100644 --- a/spec/services/census_kids_authorization_handler_spec.rb +++ b/spec/services/census_kids_authorization_handler_spec.rb @@ -98,8 +98,8 @@ it { is_expected.not_to be_valid } end - context "when it's under 10" do - let(:date_of_birth) { 9.years.ago } + context "when it's under 8" do + let(:date_of_birth) { 7.years.ago } it { is_expected.not_to be_valid } end diff --git a/spec/system/census_kids_authorization_spec.rb b/spec/system/census_kids_authorization_spec.rb index 48a02631e..311276dc1 100644 --- a/spec/system/census_kids_authorization_spec.rb +++ b/spec/system/census_kids_authorization_spec.rb @@ -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" @@ -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 @@ -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