Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dblock/email-example-spec
Integration testing with e-mail examples.
https://github.com/dblock/email-example-spec
Last synced: 16 days ago
JSON representation
Integration testing with e-mail examples.
- Host: GitHub
- URL: https://github.com/dblock/email-example-spec
- Owner: dblock
- License: mit
- Created: 2015-04-06T23:16:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-04-14T21:42:32.000Z (over 9 years ago)
- Last Synced: 2024-05-09T20:09:53.037Z (6 months ago)
- Language: Ruby
- Size: 160 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
EmailExampleSpec
================[![Build Status](https://travis-ci.org/dblock/email-example-spec.png)](https://travis-ci.org/dblock/email-example-spec)
[![Gem Version](https://badge.fury.io/rb/email-example-spec.svg)](http://badge.fury.io/rb/email-example-spec)VCR for e-mail templates.
## Installation
```ruby
gem 'email-example-spec'
```## Configuration
Configure the root directory of your mail fixtures in *spec/spec_helper.rb*.
```ruby
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
```ruby
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](CONTRIBUTING.md).
## Copyright and License
Copyright (c) 2015, Daniel Doubrovkine, Artsy and [Contributors](CHANGELOG.md).
This project is licensed under the [MIT License](LICENSE.md).