From c6738bf223693af2cd2e486adec2fcfea6ab92c9 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Mon, 27 Mar 2017 15:32:11 +0200 Subject: [PATCH] Rename Mr in M. --- app/decorators/france_connect_information_decorator.rb | 2 +- app/decorators/user_decorator.rb | 2 +- app/views/dossiers/etapes/etape_2/_individual.html.haml | 2 +- spec/controllers/users/dossiers_controller_spec.rb | 4 ++-- spec/decorators/france_connect_inforation_decorator_spec.rb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/decorators/france_connect_information_decorator.rb b/app/decorators/france_connect_information_decorator.rb index 27e69987d..503caee5b 100644 --- a/app/decorators/france_connect_information_decorator.rb +++ b/app/decorators/france_connect_information_decorator.rb @@ -2,6 +2,6 @@ class FranceConnectInformationDecorator < Draper::Decorator delegate_all def gender_fr - gender == 'female' ? 'Mme' : 'Mr' + gender == 'female' ? 'Mme' : 'M.' end end diff --git a/app/decorators/user_decorator.rb b/app/decorators/user_decorator.rb index 97430e215..d870ccd0a 100644 --- a/app/decorators/user_decorator.rb +++ b/app/decorators/user_decorator.rb @@ -2,7 +2,7 @@ class UserDecorator < Draper::Decorator delegate_all def gender_fr - return 'Mr' if gender == 'male' + return 'M.' if gender == 'male' return 'Mme' if gender == 'female' end diff --git a/app/views/dossiers/etapes/etape_2/_individual.html.haml b/app/views/dossiers/etapes/etape_2/_individual.html.haml index ae1d3a56e..8e8a457e3 100644 --- a/app/views/dossiers/etapes/etape_2/_individual.html.haml +++ b/app/views/dossiers/etapes/etape_2/_individual.html.haml @@ -16,7 +16,7 @@ %label %h4 Civilité - = ff.select :gender, ['Mr', 'Mme'] + = ff.select :gender, ['M.', 'Mme'] .form-group %label %h4 diff --git a/spec/controllers/users/dossiers_controller_spec.rb b/spec/controllers/users/dossiers_controller_spec.rb index 72752b1f1..6d77ce488 100644 --- a/spec/controllers/users/dossiers_controller_spec.rb +++ b/spec/controllers/users/dossiers_controller_spec.rb @@ -364,14 +364,14 @@ describe Users::DossiersController, type: :controller 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(: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) } before do dossier.reload 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.prenom).to eq 'Xavier' } it { expect(dossier.individual.birthdate).to eq '20/01/1991' } diff --git a/spec/decorators/france_connect_inforation_decorator_spec.rb b/spec/decorators/france_connect_inforation_decorator_spec.rb index 9d273c487..d6d642fc3 100644 --- a/spec/decorators/france_connect_inforation_decorator_spec.rb +++ b/spec/decorators/france_connect_inforation_decorator_spec.rb @@ -8,7 +8,7 @@ describe FranceConnectInformationDecorator do context 'when france connect user is a male' do let(:gender) { 'male' } - it { is_expected.to eq 'Mr' } + it { is_expected.to eq 'M.' } end context 'when france connect user is a female' do