Created
March 14, 2020 18:39
-
-
Save donrestarone/9d723dc9d13321be77e9bf604cbb07fc to your computer and use it in GitHub Desktop.
a simple user_mailer spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rails_helper" | |
RSpec.describe UserMailer, type: :mailer do | |
it 'sends a welcome email to user with password confirmation link' do | |
user = create_new_user | |
subject_line = "Welcome to this generic SaaS product #{user.first_name.capitalize}! Please confirm your email" | |
generated_email = UserMailer.welcome_email_confirmation(user) | |
expect(generated_email.subject).to eql subject_line | |
expect(generated_email.to[0]).to eql user.email | |
expect(generated_email.from[0]).to eql 'you@yourdomain.com' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment