<%= form_for @user, url: management_users_path do |f| %>
<%= f.hidden_field :document_type %>
@@ -15,7 +15,13 @@
<%= f.text_field :email,
label: t('management.email_label'),
placeholder: t('management.email_label') %>
-
+
+ <%= f.label t("management.date_of_birth") %>
+ <%= f.date_select :date_of_birth,
+ prompt: true,
+ start_year: 1900, end_year: 16.years.ago.year,
+ label: false %>
+
<%= f.submit t("management.users.create_user_submit"), class: "button success" %>
<% end %>
diff --git a/config/locales/management.en.yml b/config/locales/management.en.yml
index 25032010e..d8aaf826c 100644
--- a/config/locales/management.en.yml
+++ b/config/locales/management.en.yml
@@ -32,6 +32,7 @@ en:
under_age: "You don't have the required age to verify your account."
verify: Verify
email_label: Email
+ date_of_birth: Date of birth
email_verifications:
already_verified: This user account is already verified.
choose_options: 'Please choose one of the following options:'
diff --git a/config/locales/management.es.yml b/config/locales/management.es.yml
index 9ac276f3a..10543798a 100644
--- a/config/locales/management.es.yml
+++ b/config/locales/management.es.yml
@@ -32,6 +32,7 @@ es:
under_age: No tienes edad suficiente para verificar tu cuenta.
verify: Verificar usuario
email_label: Email
+ date_of_birth: Fecha de nacimiento
email_verifications:
already_verified: Esta cuenta de usuario ya está verificada.
choose_options: 'Elige una de las opciones siguientes:'
diff --git a/spec/features/management/users_spec.rb b/spec/features/management/users_spec.rb
index 694720cc0..5d08ce711 100644
--- a/spec/features/management/users_spec.rb
+++ b/spec/features/management/users_spec.rb
@@ -18,6 +18,7 @@ feature 'Users' do
fill_in 'user_username', with: 'pepe'
fill_in 'user_email', with: 'pepe@gmail.com'
+ select_date '31-December-1980', from: 'user_date_of_birth'
click_button 'Create user'
@@ -28,6 +29,7 @@ feature 'Users' do
expect(user).to be_level_three_verified
expect(user).to be_residence_verified
expect(user).to_not be_confirmed
+ expect(user.date_of_birth).to have_content (Date.new(1980,12,31))
sent_token = /.*confirmation_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1]
visit user_confirmation_path(confirmation_token: sent_token)