[link to #4557] An instructeur cannot change its email on its own
This commit is contained in:
parent
21910c959e
commit
058442c84e
2 changed files with 21 additions and 0 deletions
|
@ -60,5 +60,18 @@ describe Users::ProfilController, type: :controller do
|
|||
it { expect(response).to redirect_to(profil_path) }
|
||||
it { expect(flash.alert).to eq(['Email invalide']) }
|
||||
end
|
||||
|
||||
context 'when the user has an instructeur role' do
|
||||
let(:instructeur_email) { 'instructeur_email@a.com' }
|
||||
let!(:user) { create(:instructeur, email: instructeur_email).user }
|
||||
|
||||
before do
|
||||
patch :update_email, params: { user: { email: 'loulou@lou.com' } }
|
||||
user.reload
|
||||
end
|
||||
|
||||
it { expect(user.unconfirmed_email).to be_nil }
|
||||
it { expect(response).to redirect_to(profil_path) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue