Easily test ActionMailer and Mail emails in your Capybara integration tests
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install capybara-email
# rspec example feature 'Emailer' do background do # will clear the mail queue clear_emails visit email_trigger_path # Will find an email sent to email@example.com # and set the `current_email` helper open_email('firstname.lastname@example.org') end scenario 'following a link' do current_email.click_link 'your profile' page.should have_content 'Profile page' end scenario 'testing for content' do current_email.should have_content 'Hello Joe!' end end
This gem follows Semantic Versioning
Want to help?
Stable branches are created based upon each minor version. Please make pull requests to specific branches rather than master.
Please make sure you include tests!
Unless Rails drops support for Ruby 1.8.7 we will continue to use the hash-rocket syntax. Please respect this.
Don't use tabs to indent, two spaces are the standard.
DockYard, LLC © 2012