Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #14395 from arthurnn/fix_mailer_preview_test

Fix MailerPreview broken tests
  • Loading branch information...
commit 6ebcf7b1a5747b2ff8aa064de0326f56a962d3b5 1 parent 11a4463
Jeremy Kemper jeremy authored rafaelfranca committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 actionmailer/test/base_test.rb
8 actionmailer/test/base_test.rb
View
@@ -594,7 +594,7 @@ def welcome
test "you can register a preview interceptor to the mail object that gets passed the mail object before previewing" do
ActionMailer::Base.register_preview_interceptor(MyInterceptor)
mail = BaseMailer.welcome
- BaseMailerPreview.stubs(:welcome).returns(mail)
+ BaseMailerPreview.any_instance.stubs(:welcome).returns(mail)
MyInterceptor.expects(:previewing_email).with(mail)
BaseMailerPreview.call(:welcome)
end
@@ -602,7 +602,7 @@ def welcome
test "you can register a preview interceptor using its stringified name to the mail object that gets passed the mail object before previewing" do
ActionMailer::Base.register_preview_interceptor("BaseTest::MyInterceptor")
mail = BaseMailer.welcome
- BaseMailerPreview.stubs(:welcome).returns(mail)
+ BaseMailerPreview.any_instance.stubs(:welcome).returns(mail)
MyInterceptor.expects(:previewing_email).with(mail)
BaseMailerPreview.call(:welcome)
end
@@ -610,7 +610,7 @@ def welcome
test "you can register an interceptor using its symbolized underscored name to the mail object that gets passed the mail object before previewing" do
ActionMailer::Base.register_preview_interceptor(:"base_test/my_interceptor")
mail = BaseMailer.welcome
- BaseMailerPreview.stubs(:welcome).returns(mail)
+ BaseMailerPreview.any_instance.stubs(:welcome).returns(mail)
MyInterceptor.expects(:previewing_email).with(mail)
BaseMailerPreview.call(:welcome)
end
@@ -618,7 +618,7 @@ def welcome
test "you can register multiple preview interceptors to the mail object that both get passed the mail object before previewing" do
ActionMailer::Base.register_preview_interceptors("BaseTest::MyInterceptor", MySecondInterceptor)
mail = BaseMailer.welcome
- BaseMailerPreview.stubs(:welcome).returns(mail)
+ BaseMailerPreview.any_instance.stubs(:welcome).returns(mail)
MyInterceptor.expects(:previewing_email).with(mail)
MySecondInterceptor.expects(:previewing_email).with(mail)
BaseMailerPreview.call(:welcome)
Please sign in to comment.
Something went wrong with that request. Please try again.