= Email Spec A collection of RSpec matchers and Cucumber steps to make testing emails go smoothly. == Setup script/plugin install git://github.com/bmabey/email-spec.git === Gem Setup (may or may not work atm) gem install mischa-email_spec # config/environments/test.rb config.gem 'email_spec' === Cucumber To use the steps in features put the following in your env.rb: # Make sure this require is after you require cucumber/rails/world. require 'email_spec/cucumber' === RSpec The matchers and helpers should be available for your specs by default, but you need to include them into the example groups you want to use them in. To include them in all of your specs you can do this in your spec_helper.rb: Spec::Runner.configure do |config| config.include(EmailSpec::Helpers) config.include(EmailSpec::Matchers) end == Usage === Cucumber Scenario: A new person signs up Given I am at "/" And a clear email queue When I fill in "Email" with "quentin@example.com" And I fill in "Password" with "monkey" And I fill in "Password confirmation" with "monkey" And I press "Sign up" Then "quentin@example.com" should receive 1 email And "quentin@example.com" should have 1 email And "foo@bar.com" should not receive an email When I open the email Then I should see "confirm" in the email And I should see "Account confirmation" in the subject When I follow "confirm" in the email Then I should see "Confirm your new account" Check out an app that implements these features at http://github.com/bmabey/email-spec-sample-app == TODO: - refactor! - provide custom matchers to give better messages == Authors Ben Mabey, Aaron Gibralter, Mischa Fierer