Merge pull request #5779 from betagouv/update-civilite

presente la civilité par ordre alphabétique
This commit is contained in:
Paul Chavard 2020-12-09 09:19:01 +01:00 committed by GitHub
commit 5abb07420b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 18 additions and 15 deletions

View file

@ -19,7 +19,7 @@ class Individual < ApplicationRecord
validates :nom, presence: true, allow_blank: false, allow_nil: false, on: :update
validates :prenom, presence: true, allow_blank: false, allow_nil: false, on: :update
GENDER_MALE = 'M.'
GENDER_MALE = "M."
GENDER_FEMALE = 'Mme'
def self.from_france_connect(fc_information)

View file

@ -2,9 +2,9 @@
%legend.mandatory-explanation
Sélectionnez une des valeurs
%label
= form.radio_button :value, Individual::GENDER_MALE
Monsieur
= form.radio_button :value, Individual::GENDER_FEMALE
= t(Individual::GENDER_FEMALE, scope: 'activerecord.attributes.individual.gender_options')
%label
= form.radio_button :value, Individual::GENDER_FEMALE
Madame
= form.radio_button :value, Individual::GENDER_MALE
= t('activerecord.attributes.individual.gender_options')[Individual::GENDER_MALE.to_sym] # GENDER_MALE contains a point letter

View file

@ -12,12 +12,12 @@
%legend
= f.label :gender
.radios
%label
= f.radio_button :gender, Individual::GENDER_MALE, required: true
= Individual::GENDER_MALE
%label
= f.radio_button :gender, Individual::GENDER_FEMALE, required: true
= Individual::GENDER_FEMALE
= t(Individual::GENDER_FEMALE, scope: 'activerecord.attributes.individual.gender_options')
%label
= f.radio_button :gender, Individual::GENDER_MALE, required: true
= t('activerecord.attributes.individual.gender_options')[Individual::GENDER_MALE.to_sym] # GENDER_MALE contains a point letter
.flex
.inline-champ

View file

@ -6,3 +6,6 @@ fr:
nom: Nom
prenom: Prénom
birthdate: Date de naissance
gender_options:
"Mme": "Madame"
"M." : "Monsieur"

View file

@ -57,7 +57,7 @@ FactoryBot.define do
factory :champ_civilite, class: 'Champs::CiviliteChamp' do
type_de_champ { association :type_de_champ_civilite, procedure: dossier.procedure }
value { 'M.' }
value { 'Monsieur' }
end
factory :champ_email, class: 'Champs::EmailChamp' do

View file

@ -57,7 +57,7 @@ feature 'wcag rules for usager', js: true do
scenario "dépot d'un dossier" do
click_on 'Commencer la démarche'
choose 'M.'
choose 'Monsieur'
fill_in('individual_prenom', with: 'prenom')
fill_in('individual_nom', with: 'nom')
click_on 'Continuer'

View file

@ -185,7 +185,7 @@ feature 'The routing', js: true do
visit commencer_path(path: procedure.reload.path)
click_on 'Commencer la démarche'
choose 'M.'
choose 'Monsieur'
fill_in 'individual_nom', with: 'Nom'
fill_in 'individual_prenom', with: 'Prenom'
click_button('Continuer')

View file

@ -329,7 +329,7 @@ feature 'The user' do
end
def fill_individual
choose 'M.'
choose 'Monsieur'
fill_in('individual_prenom', with: 'prenom')
fill_in('individual_nom', with: 'nom')
click_on 'Continuer'

View file

@ -20,7 +20,7 @@ feature 'Creating a new dossier:' do
expect(page).to have_current_path identite_dossier_path(user.reload.dossiers.last)
expect(page).to have_procedure_description(procedure)
choose 'M.'
choose 'Monsieur'
fill_in 'individual_nom', with: 'Nom'
fill_in 'individual_prenom', with: 'Prenom'
end

View file

@ -57,7 +57,7 @@ feature 'linked dropdown lists' do
end
def fill_individual
choose 'M.'
choose 'Monsieur'
fill_in('individual_prenom', with: 'prenom')
fill_in('individual_nom', with: 'nom')
click_on 'Continuer'