Merge pull request #10040 from colinux/cross-domain-component
Prépare la bannière informant du changement de nom de domaine, avec redirection automatique le cas échéant
This commit is contained in:
commit
17f9992722
24 changed files with 218 additions and 16 deletions
|
@ -42,6 +42,10 @@ describe Users::RegistrationsController, type: :controller do
|
|||
post :create, params: { user: user }
|
||||
end
|
||||
|
||||
before do
|
||||
allow(Current).to receive(:host).and_return(ENV.fetch("APP_HOST"))
|
||||
end
|
||||
|
||||
context 'when user is correct' do
|
||||
it 'sends confirmation instruction' do
|
||||
message = double()
|
||||
|
@ -49,6 +53,8 @@ describe Users::RegistrationsController, type: :controller do
|
|||
expect(message).to receive(:deliver_later)
|
||||
|
||||
subject
|
||||
|
||||
expect(User.last.preferred_domain_demarches_gouv_fr?).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -65,6 +65,18 @@ describe Users::SessionsController, type: :controller do
|
|||
expect(flash.alert).to eq("Adresse électronique ou mot de passe incorrect.")
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user has not yet a preferred domain' do
|
||||
before do
|
||||
allow(Current).to receive(:host).and_return(ENV.fetch("APP_HOST"))
|
||||
end
|
||||
|
||||
it 'update preferred domain' do
|
||||
subject
|
||||
|
||||
expect(user.reload.preferred_domain_demarches_gouv_fr?).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the credentials are wrong' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue