Created
September 15, 2014 11:20
-
-
Save maxcal/bcf9d4008a1b760264f7 to your computer and use it in GitHub Desktop.
Testing multipart emails with rspec/capybara
This file contains hidden or 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
| # Sets up `text` and `html` variables that can be used to test the different parts of a multipart email | |
| RSpec.shared_context 'multipart email' do | |
| let(:html) do | |
| Capybara::Node::Simple.new( mail.body.parts.find {|p| p.content_type.match /html/}.body.raw_source ) | |
| end | |
| let(:text) { mail.body.parts.find {|p| p.content_type.match /plain/}.body.raw_source } | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment