Test send email when gestionnaire invite user
This commit is contained in:
parent
bd63116d5a
commit
bc41412b6b
1 changed files with 14 additions and 0 deletions
|
@ -62,11 +62,25 @@ describe InvitesController, type: :controller do
|
||||||
|
|
||||||
describe 'send invitation email' do
|
describe 'send invitation email' do
|
||||||
context 'when user does not exist' do
|
context 'when user does not exist' do
|
||||||
|
it 'send email' do
|
||||||
|
expect(InviteMailer).to receive(:invite_guest).and_return(InviteMailer)
|
||||||
|
expect(InviteMailer).to receive(:deliver_now!)
|
||||||
|
|
||||||
|
subject
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when user exist' do
|
context 'when user exist' do
|
||||||
|
before do
|
||||||
|
create :user, email: email
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'send email' do
|
||||||
|
expect(InviteMailer).to receive(:invite_user).and_return(InviteMailer)
|
||||||
|
expect(InviteMailer).to receive(:deliver_now!)
|
||||||
|
|
||||||
|
subject
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue