Merge pull request #7303 from betagouv/sentry/3267070633
bug(commencer#commencer): raise when procedure does not have a service
This commit is contained in:
commit
b793ef0ff8
5 changed files with 18 additions and 4 deletions
|
@ -70,7 +70,9 @@ module Users
|
|||
procedure = Procedure.find_by(path: params[:path])
|
||||
|
||||
if procedure&.close?
|
||||
flash.alert = t('errors.messages.procedure_archived', service_name: procedure.service.nom, service_phone_number: procedure.service.telephone, service_email: procedure.service.email)
|
||||
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)
|
||||
else
|
||||
flash.alert = t('errors.messages.procedure_not_found')
|
||||
end
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
= t('pluralize.dossier_trouve', count: @dossiers_count)
|
||||
|
||||
= pagination
|
||||
|
||||
- if @projected_dossiers.present?
|
||||
%table.table.dossiers-table.hoverable
|
||||
%thead
|
||||
|
|
|
@ -359,7 +359,9 @@ en:
|
|||
# # etablissement_fail: 'Désolé, nous n’avons pas réussi à enregistrer l’établissement correspondant à ce numéro SIRET'
|
||||
france_connect:
|
||||
connexion: "Error trying to connect to France Connect."
|
||||
procedure_archived: This procedure has been closed, it is no longer possible to submit a file. For more information, please contact the service %{service_name}, available at %{service_phone_number} or by email %{service_email}
|
||||
procedure_archived:
|
||||
with_service_and_phone_email: This procedure has been closed, it is no longer possible to submit a file. For more information, please contact the service %{service_name}, available at %{service_phone_number} or by email %{service_email}
|
||||
with_organisation_only: This procedure has been closed, it is no longer possible to submit a file. For more information, please contact the organisation %{organisation_name}
|
||||
# # procedure_not_draft: "This procedure is not a draft anymore."
|
||||
# cadastres_empty:
|
||||
# one: "Aucune parcelle cadastrale sur la zone sélectionnée"
|
||||
|
|
|
@ -364,7 +364,10 @@ fr:
|
|||
france_connect:
|
||||
connexion: "Erreur lors de la connexion à France Connect."
|
||||
forbidden_html: "Seul-e-s les usagers peuvent se connecter via France Connect. En tant qu’instructeur ou administrateur, nous vous invitons à <a href='%{reset_link}'>réininitialiser votre mot de passe</a>."
|
||||
procedure_archived: Cette démarche en ligne a été close, il n’est plus possible de déposer de dossier. Pour plus d'informations veuillez contacter le service %{service_name} au %{service_phone_number} ou par email à %{service_email}
|
||||
procedure_archived:
|
||||
with_service_and_phone_email: Cette démarche en ligne a été close, il n’est plus possible de déposer de dossier. Pour plus d'informations veuillez contacter le service %{service_name} au %{service_phone_number} ou par email à %{service_email}
|
||||
with_organisation_only: Cette démarche en ligne a été close, il n’est plus possible de déposer de dossier. Pour plus d'informations veuillez contacter le service %{organisation_name}
|
||||
|
||||
empty_repetition: '« %{value} » doit comporter au moins un champ répétable'
|
||||
empty_drop_down: '« %{value} » doit comporter au moins un choix sélectionnable'
|
||||
# procedure_not_draft: "Cette démarche n’est maintenant plus en brouillon."
|
||||
|
|
|
@ -32,6 +32,14 @@ describe Users::CommencerController, type: :controller do
|
|||
expect(subject).to redirect_to(root_path)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when procedure is closed' do
|
||||
it 'works' do
|
||||
published_procedure.close!
|
||||
get :commencer, params: { path: published_procedure.path }
|
||||
expect(response).to redirect_to(root_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#commencer_test' do
|
||||
|
|
Loading…
Reference in a new issue