1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Feature: Mailer specs
Scenario: A simple passing example
Given a file named "spec/mailers/notifications_mailer_spec.rb" with:
"""ruby
require "rails_helper"
RSpec.describe NotificationsMailer, type: :mailer do
describe "notify" do
let(:mail) { NotificationsMailer.signup }
it "renders the headers" do
expect(mail.subject).to eq("Signup")
expect(mail.to).to eq(["to@example.org"])
expect(mail.from).to eq(["from@example.com"])
end
it "renders the body" do
expect(mail.body.encoded).to match("Hi")
end
end
end
"""
When I run `rspec spec`
Then the example should pass
|