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