Merge pull request #7313 from betagouv/sentry/3270418045

fix(commencer#commencer): broken due to missing interpolated variable in i18n
This commit is contained in:
mfo 2022-05-13 13:28:53 +02:00 committed by GitHub
commit 79972ba6a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View file

@ -71,8 +71,8 @@ module Users
if procedure&.close?
flash.alert = procedure.service.presence ?
t('errors.messages.procedure_archived.with_service_and_phone_email', service_phone_number: procedure.service.telephone, service_email: procedure.service.email) :
t('errors.messages.procedure_archived.with_organisation_only', organisation_name: procedure.organisation_name)
t('errors.messages.procedure_archived.with_service_and_phone_email', service_name: procedure.organisation, service_phone_number: procedure.service.telephone, service_email: procedure.service.email) :
t('errors.messages.procedure_archived.with_organisation_only', organisation_name: procedure.organisation)
else
flash.alert = t('errors.messages.procedure_not_found')
end

View file

@ -33,8 +33,19 @@ describe Users::CommencerController, type: :controller do
end
end
context 'when procedure is closed' do
context 'when procedure without service is closed' do
it 'works' do
published_procedure.service = nil
published_procedure.organisation = "hello"
published_procedure.close!
get :commencer, params: { path: published_procedure.path }
expect(response).to redirect_to(root_path)
end
end
context 'when procedure with service is closed' do
it 'works' do
published_procedure.service = create(:service)
published_procedure.close!
get :commencer, params: { path: published_procedure.path }
expect(response).to redirect_to(root_path)