master
1require "rails_helper"
2
3RSpec.describe UserMailer, type: :mailer do
4 describe "registration email" do
5 let(:user) { double User, username: "blah", email:"blah@example.com" }
6 let(:mail) { UserMailer.registration_email(user) }
7 it "renders the subject" do
8 expect(mail.subject).to eql("Welcome to Strong Lifters.")
9 end
10 it "renders the recipient email" do
11 expect(mail.to).to eql([user.email])
12 end
13 it "renders the sender email" do
14 expect(mail.from).to eql(["from@example.com"])
15 end
16 it "assigns a username" do
17 expect(mail.body.encoded).to match(user.username)
18 end
19 end
20end