blob: 0aebf2cab4cc68a0afbe01747a3f2f279adea56e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
require "rails_helper"
describe UserMailer do
context "send welcome email" do
let(:user) { build(:user) }
let(:mail) { UserMailer.welcome_email(user) }
it "adds a subject" do
expect(mail.subject).to eql("Welcome to CakeSide")
end
it "sends to the users email" do
expect(mail.to).to match_array([user.email])
end
it "should send from the correct address" do
expect(mail.from).to match_array(['noreply@cakeside.com'])
end
it "includes their name" do
expect(mail.body.encoded).to match(user.name)
end
end
end
|