Test send email when gestionnaire invite user

This commit is contained in:
Xavier J 2016-02-09 10:51:15 +01:00
parent bd63116d5a
commit bc41412b6b

View file

@ -62,11 +62,25 @@ describe InvitesController, type: :controller do
describe 'send invitation email' 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
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