summaryrefslogtreecommitdiff
path: root/spec/mailers/notification_mailer_spec.rb
blob: ff1415faebe8af47ac10c1fe0d6f38153cf15413 (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 NotificationMailer do
  context "send welcome email" do
    let(:user) { build(:user) }
    let(:mail) { NotificationMailer.notification_email(user) }

    it "adds a subject" do
      expect(mail.subject).to eql("New Activity on 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