Skip to content

Instantly share code, notes, and snippets.

@rsl
Created January 25, 2013 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsl/4636547 to your computer and use it in GitHub Desktop.
Save rsl/4636547 to your computer and use it in GitHub Desktop.
require 'test_helper'
class SubscriptionNotifierTest < ActionMailer::TestCase
fixtures :companies
should_eventually "test other subscription mailer actions"
test 'should send cancellation email' do
company = companies(:no_categories)
email = SubscriptionNotifier.cancelled_subscription(company).deliver
assert_contains email.to, 'something@somethingelse.com'
assert_equal "Cancelled Subscription", email.subject
assert_match /#{company.organization} subscription has been cancelled/, email.body
end
end
# raises TypeError: can't convert Mail::Body to String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment