aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/mail_helper_test.rb
diff options
context:
space:
mode:
authorJavan Makhmali <javan@javan.us>2015-04-28 09:46:17 -0600
committerJavan Makhmali <javan@javan.us>2015-04-28 13:56:42 -0600
commit20f6f646d130ed3ef28f3632a76ab2502ea3b209 (patch)
tree38843c00e063c6e593d4af322ea8795839c7f290 /actionmailer/test/mail_helper_test.rb
parent7bc45df1823c3aa02afc56c850c07fe2e6c1b66c (diff)
downloadrails-20f6f646d130ed3ef28f3632a76ab2502ea3b209.tar.gz
rails-20f6f646d130ed3ef28f3632a76ab2502ea3b209.tar.bz2
rails-20f6f646d130ed3ef28f3632a76ab2502ea3b209.zip
Make ActionMailer #cache helper a no-op, not an exception
Diffstat (limited to 'actionmailer/test/mail_helper_test.rb')
-rw-r--r--actionmailer/test/mail_helper_test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/actionmailer/test/mail_helper_test.rb b/actionmailer/test/mail_helper_test.rb
index 24ccaab8df..ff6b25b0c7 100644
--- a/actionmailer/test/mail_helper_test.rb
+++ b/actionmailer/test/mail_helper_test.rb
@@ -59,6 +59,12 @@ The second
end
end
+ def use_cache
+ mail_with_defaults do |format|
+ format.html { render(inline: "<% cache(:foo) do %>Greetings from a cache helper block<% end %>") }
+ end
+ end
+
protected
def mail_with_defaults(&block)
@@ -107,5 +113,11 @@ class MailerHelperTest < ActionMailer::TestCase
TEXT
assert_equal expected.gsub("\n", "\r\n"), mail.body.encoded
end
-end
+ def test_use_cache
+ assert_nothing_raised do
+ mail = HelperMailer.use_cache
+ assert_equal "Greetings from a cache helper block", mail.body.encoded
+ end
+ end
+end