Tuesday, January 4, 2011

Testing emails with Rails, Steak and email_spec

We've started experimenting with switching from Cucumber to Steak.
Here is how you can use email_spec inside Steak scenarios:

Gemfile
gem 'email_spec', "1.1.1"

spec/acceptance/acceptance_helper.rb
require "email_spec"

spec/acceptance/commenting_spec.rb
feature "Commenting" do
  include EmailSpec::Helpers
  
  scenario "email notification about a comment" do
    find_email(email, :with_text => text).should_not == nil
  end
end

No comments: