feat(file retrieval): contact support if not col ter
This commit is contained in:
parent
b7c48acf86
commit
d3955d48ee
3 changed files with 38 additions and 2 deletions
|
@ -6,7 +6,7 @@ class RecoveriesController < ApplicationController
|
|||
if nature_params == 'collectivite'
|
||||
redirect_to identification_recovery_path
|
||||
else
|
||||
redirect_to support_recovery_path
|
||||
redirect_to support_recovery_path(error: :other_nature)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -3,4 +3,11 @@
|
|||
.fr-container.fr-my-6w
|
||||
%h1.fr-h1 Récupération de dossiers
|
||||
|
||||
%h2.fr-h2 Veuillez contacter le support
|
||||
- case params[:error]
|
||||
- when 'other_nature'
|
||||
%p Votre situation nécessite un traitement particulier.
|
||||
|
||||
= mail_to(CONTACT_EMAIL,
|
||||
'Contactez le support',
|
||||
subject: 'Récupération de dossiers',
|
||||
class: 'fr-btn')
|
||||
|
|
29
spec/controllers/recoveries_controller_spec.rb
Normal file
29
spec/controllers/recoveries_controller_spec.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
describe RecoveriesController, type: :controller do
|
||||
describe 'GET #nature' do
|
||||
subject { get :nature }
|
||||
|
||||
it { is_expected.to have_http_status(:success) }
|
||||
end
|
||||
|
||||
describe 'POST #post_nature' do
|
||||
subject { post :post_nature, params: { nature: nature } }
|
||||
|
||||
context 'when nature is collectivite' do
|
||||
let(:nature) { 'collectivite' }
|
||||
|
||||
it { is_expected.to redirect_to(identification_recovery_path) }
|
||||
end
|
||||
|
||||
context 'when nature is not collectivite' do
|
||||
let(:nature) { 'other' }
|
||||
|
||||
it { is_expected.to redirect_to(support_recovery_path(error: :other_nature)) }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'Get #support' do
|
||||
subject { get :support }
|
||||
|
||||
it { is_expected.to have_http_status(:success) }
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue