No commit activity in last 3 years
No release in over 3 years
Integration testing with e-mail examples.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

EmailExampleSpec

Build Status Gem Version

VCR for e-mail templates.

Installation

gem 'email-example-spec'

Configuration

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

Usage

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

Details

This gem patches e-mail dates, message IDs and content-type boundaries and exports e-mail contents, including headers, into a file that can be read in subsequent runs. It essentially provides integration testing for e-mail templates.

Contributing

See CONTRIBUTING.

Copyright and License

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

This project is licensed under the MIT License.