fix(commencer#commencer): broken due to missing interpolated variable in i18n

This commit is contained in:
Martin 2022-05-13 13:15:31 +02:00
parent 467eee0e76
commit da57a1dc9e
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)