Rename Mr in M.

This commit is contained in:
gregoirenovel 2017-03-27 15:32:11 +02:00
parent 46a87b3283
commit c6738bf223
5 changed files with 6 additions and 6 deletions

View file

@ -2,6 +2,6 @@ class FranceConnectInformationDecorator < Draper::Decorator
delegate_all delegate_all
def gender_fr def gender_fr
gender == 'female' ? 'Mme' : 'Mr' gender == 'female' ? 'Mme' : 'M.'
end end
end end

View file

@ -2,7 +2,7 @@ class UserDecorator < Draper::Decorator
delegate_all delegate_all
def gender_fr def gender_fr
return 'Mr' if gender == 'male' return 'M.' if gender == 'male'
return 'Mme' if gender == 'female' return 'Mme' if gender == 'female'
end end

View file

@ -16,7 +16,7 @@
%label %label
%h4 %h4
Civilité Civilité
= ff.select :gender, ['Mr', 'Mme'] = ff.select :gender, ['M.', 'Mme']
.form-group .form-group
%label %label
%h4 %h4

View file

@ -364,14 +364,14 @@ describe Users::DossiersController, type: :controller do
context 'when procedure is for individual' do context 'when procedure is for individual' do
let(:params) { {id: dossier_id, dossier: {id: dossier_id, autorisation_donnees: '1', individual_attributes: individual_params}} } let(:params) { {id: dossier_id, dossier: {id: dossier_id, autorisation_donnees: '1', individual_attributes: individual_params}} }
let(:individual_params) { {gender: 'Mr', nom: 'Julien', prenom: 'Xavier', birthdate: '20/01/1991'} } let(:individual_params) { {gender: 'M.', nom: 'Julien', prenom: 'Xavier', birthdate: '20/01/1991'} }
let(:procedure) { create(:procedure, :published, for_individual: true) } let(:procedure) { create(:procedure, :published, for_individual: true) }
before do before do
dossier.reload dossier.reload
end end
it { expect(dossier.individual.gender).to eq 'Mr' } it { expect(dossier.individual.gender).to eq 'M.' }
it { expect(dossier.individual.nom).to eq 'Julien' } it { expect(dossier.individual.nom).to eq 'Julien' }
it { expect(dossier.individual.prenom).to eq 'Xavier' } it { expect(dossier.individual.prenom).to eq 'Xavier' }
it { expect(dossier.individual.birthdate).to eq '20/01/1991' } it { expect(dossier.individual.birthdate).to eq '20/01/1991' }

View file

@ -8,7 +8,7 @@ describe FranceConnectInformationDecorator do
context 'when france connect user is a male' do context 'when france connect user is a male' do
let(:gender) { 'male' } let(:gender) { 'male' }
it { is_expected.to eq 'Mr' } it { is_expected.to eq 'M.' }
end end
context 'when france connect user is a female' do context 'when france connect user is a female' do