GreenStepsChatt / greensteps

This is the web app for Green Steps, a community focused initiative that incentivizes litter cleanup in the Chattanooga area.
https://www.greenstepschatt.com/
MIT License
12 stars 31 forks source link

Add ActionMailer related configs to test environment #115

Closed crawfoal closed 6 years ago

crawfoal commented 6 years ago

Here is an example from an article by thoughtbot:

# config/environments/test.rb
config.action_mailer.delivery_method = :test
config.action_mailer.default_url_options = { host: "example.com" }

# spec/support/action_mailer.rb
RSpec.configure do |config|
  config.before(:each) do
    ActionMailer::Base.deliveries.clear
  end
end

# spec/support/mailer_helpers.rb
module MailerHelpers
  def emails
    ActionMailer::Base.deliveries
  end

  def last_email
    emails.last
  end
end

RSpec.configure do |config|
  config.include MailerHelpers, type: :mailer
end
crawfoal commented 6 years ago

Do in same PR as issue #113 and #114