adds date of birth form when manager creates new user
This commit is contained in:
@@ -32,7 +32,7 @@ class Management::UsersController < Management::BaseController
|
||||
private
|
||||
|
||||
def user_params
|
||||
params.require(:user).permit(:document_type, :document_number, :username, :email)
|
||||
params.require(:user).permit(:document_type, :document_number, :username, :email, :date_of_birth)
|
||||
end
|
||||
|
||||
def destroy_session
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
message: t("management.document_verifications.in_census_has_following_permissions"),
|
||||
permissions: [:debates, :create_proposals, :support_proposals, :vote_proposals] %>
|
||||
|
||||
<div class="row">
|
||||
<div class="row verification account">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= 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') %>
|
||||
|
||||
<div class="date-of-birth">
|
||||
<%= 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 %>
|
||||
</div>
|
||||
<%= f.submit t("management.users.create_user_submit"), class: "button success" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -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:'
|
||||
|
||||
@@ -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:'
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user