ExampleExampleSpec

Build Status

VCR for e-mail templates.

Install

gem 'email-example-spec'

Configure

Configure the root directory of your mail fixtures in spec/spec_helper.rb.

EmailExampleSpec.configure do |config|
  config.record = true # record new e-mails, don't commit this!
  config.fixture_path = File.join(Rails.root, 'spec/support/fixtures/emails')
end

Use

describe WelcomeMailer do
  let(:user) { User.new }
  subject do
    WelcomeMailer.welcome(user)
  end
  it 'works' do
    expect(subject).to match_email_example_in 'welcome_mail.txt'
  end
end

Contributing

See CONTRIBUTING.

Copyright (c) 2015, Daniel Doubrovkine, Artsy and Contributors.

This project is licensed under the MIT License.