Sha256: 00c668cc0974115db9e0f1700dbaea3763594d19f7e63eb9b4a0d11cfb79bff3

Contents?: true

Size: 957 Bytes

Versions: 4

Compression:

Stored size: 957 Bytes

Contents

# Require this in your spinach features/support/env.rb file to get access
# to the helpers and matchers in your steps.

if defined?(ActionMailer)
  unless [:test, :activerecord, :cache, :file].include?(ActionMailer::Base.delivery_method)
    ActionMailer::Base.register_observer(EmailSpec::TestObserver)
  end
  ActionMailer::Base.perform_deliveries = true

  Spinach.hooks.before_scenario do
    # Scenario setup
    case ActionMailer::Base.delivery_method
      when :test then ActionMailer::Base.deliveries.clear
      when :cache then ActionMailer::Base.clear_cache
    end
  end
end

Spinach.hooks.after_scenario do
  EmailSpec::EmailViewer.save_and_open_all_raw_emails if ENV['SHOW_EMAILS']
  EmailSpec::EmailViewer.save_and_open_all_html_emails if ENV['SHOW_HTML_EMAILS']
  EmailSpec::EmailViewer.save_and_open_all_text_emails if ENV['SHOW_TEXT_EMAILS']
end

class Spinach::FeatureSteps
  include EmailSpec::Helpers
  include EmailSpec::Matchers
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
email_spec-2.3.0 lib/email_spec/spinach.rb
email_spec-2.2.2 lib/email_spec/spinach.rb
email_spec-2.2.1 lib/email_spec/spinach.rb
email_spec-2.2.0 lib/email_spec/spinach.rb