Permalink
Browse files

Potentially-failing integration test for #have_sent_email

  • Loading branch information...
1 parent 0142d8b commit 68ac6ae87fd798e85866aadff195535dabbc8239 @mike-burns mike-burns committed Jun 11, 2010
@@ -1,3 +1,11 @@
class Flea < ActiveRecord::Base
has_and_belongs_to_many :dogs
+
+ after_create :send_notification
+
+ private
+
+ def send_notification
+ Notifier.deliver_the_email
+ end
end
@@ -0,0 +1,8 @@
+class Notifier < ActionMailer::Base
+ def the_email
+ from "do-not-reply@example.com"
+ recipients "myself@me.com"
+ subject "This is spam"
+ body :body => "Every email is spam."
+ end
+end
@@ -0,0 +1 @@
+<%= @body %>
View
@@ -2,5 +2,7 @@
class FleaTest < ActiveSupport::TestCase
should_have_and_belong_to_many :dogs
+
+ should have_sent_email.to('myself@me.com')
end

0 comments on commit 68ac6ae

Please sign in to comment.