commencer: fix redirection with invalid path
This commit is contained in:
parent
fb19b856c5
commit
41ad89d8ac
3 changed files with 53 additions and 14 deletions
|
@ -87,6 +87,14 @@ describe Users::CommencerController, type: :controller do
|
|||
|
||||
it { expect(subject).to redirect_to(new_user_session_path) }
|
||||
end
|
||||
|
||||
context 'when the path doesn’t exist' do
|
||||
subject { get :sign_in, params: { path: 'hello' } }
|
||||
|
||||
it 'redirects with an error message' do
|
||||
expect(subject).to redirect_to(root_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#sign_up' do
|
||||
|
@ -111,6 +119,14 @@ describe Users::CommencerController, type: :controller do
|
|||
|
||||
it { expect(subject).to redirect_to(new_user_registration_path) }
|
||||
end
|
||||
|
||||
context 'when the path doesn’t exist' do
|
||||
subject { get :sign_up, params: { path: 'hello' } }
|
||||
|
||||
it 'redirects with an error message' do
|
||||
expect(subject).to redirect_to(root_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#france_connect' do
|
||||
|
@ -135,5 +151,13 @@ describe Users::CommencerController, type: :controller do
|
|||
|
||||
it { expect(subject).to redirect_to(france_connect_particulier_path) }
|
||||
end
|
||||
|
||||
context 'when the path doesn’t exist' do
|
||||
subject { get :france_connect, params: { path: 'hello' } }
|
||||
|
||||
it 'redirects with an error message' do
|
||||
expect(subject).to redirect_to(root_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue