Skip to content

Commit

Permalink
refactor: be month explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSim committed Feb 14, 2025
1 parent fb577de commit 5f9d510
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions config/locales/time_format.fr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
}
},

date: {
formats: {
default: "%d %B %Y"
}
},

datetime: {
distance_in_words: {
x_weeks: {
Expand Down
4 changes: 2 additions & 2 deletions spec/components/instructeurs/cell_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

before { dossier.champs.first.update(value: Date.parse("12/02/2025")) }

it { is_expected.to eq('12/02/2025') }
it { is_expected.to eq('12 février 2025') }
end

context 'for a datetime column' do
Expand All @@ -102,7 +102,7 @@
etablissement.update_champ_value_json!
}

it { is_expected.to eq('10/08/2015') }
it { is_expected.to eq('10 août 2015') }
end

context 'for a enum column' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
context 'dossier en instruction' do
let(:dossier) { create(:dossier, :en_instruction, procedure:, sva_svr_decision_on: Date.new(2023, 9, 5)) }
it { expect(subject).to have_text("dans 4 jours") }
it { expect(title).to have_text("sera automatiquement traité le 05/09/2023") }
it { expect(title).to have_text("sera automatiquement traité le 05 septembre 2023") }

context 'with label' do
let(:with_label) { true }
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/dossier_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
context "with complete france_connect information" do
let(:user_information) { build(:france_connect_information, updated_at: Time.zone.now) }
it {
expect(subject).to have_text("Le dossier a été déposé par le compte de #{user_information.given_name} #{user_information.family_name}, authentifié par FranceConnect le #{user_information.updated_at.strftime('%d/%m/%Y')}")
expect(subject).to have_text("Le dossier a été déposé par le compte de #{user_information.given_name} #{user_information.family_name}, authentifié par FranceConnect le #{I18n.l(user_information.updated_at.to_date)}")
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/system/administrateurs/procedure_closing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

procedure.reload

expect(page).to have_text("Un email a été envoyé pour informer les usagers le #{procedure.closed_at.strftime('%d/%m/%Y')}")
expect(page).to have_text("Un email a été envoyé pour informer les usagers le #{I18n.l(procedure.closed_at.to_date)}")
end
end
end
6 changes: 3 additions & 3 deletions spec/system/api_particulier/api_particulier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@
expect(page).to have_content('pays FRANCE')
expect(page).to have_content('complément d’identité géographique au nord de paris')
expect(page).to have_content('lieu-dit glagla')
expect(page).to have_content('ERIC SNOW masculin 07/01/1991')
expect(page).to have_content('SANSA SNOW féminin 15/01/1992')
expect(page).to have_content('PAUL SNOW masculin 04/01/2018')
expect(page).to have_content('ERIC SNOW masculin 07 janvier 1991')
expect(page).to have_content('SANSA SNOW féminin 15 janvier 1992')
expect(page).to have_content('PAUL SNOW masculin 04 janvier 2018')
expect(page).to have_content('1856 6 2021')
end
end
Expand Down

0 comments on commit 5f9d510

Please sign in to comment.