aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/base_test.rb
diff options
context:
space:
mode:
authorAlex Tsukernik <alxtskrnk@gmail.com>2013-07-22 14:23:53 -0400
committerAlex Tsukernik <alxtskrnk@gmail.com>2013-07-22 14:25:20 -0400
commit49185875a5cd7f7e7a0799e40787cb358d3ba741 (patch)
treec07ce80c9a5c66d73897442626c9ed0f42ef6843 /actionmailer/test/base_test.rb
parent1c4eb13345a0c771aab2ee47aecdd4b24acce43a (diff)
downloadrails-49185875a5cd7f7e7a0799e40787cb358d3ba741.tar.gz
rails-49185875a5cd7f7e7a0799e40787cb358d3ba741.tar.bz2
rails-49185875a5cd7f7e7a0799e40787cb358d3ba741.zip
don't convert mailer default values to procs
Invoke mailer defaults as procs only if they are procs, do not convert with to_proc. That an object is convertible to a proc does not mean it's meant to be always used as a proc. Fixes #11533
Diffstat (limited to 'actionmailer/test/base_test.rb')
-rw-r--r--actionmailer/test/base_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index b9c56c540d..b74728ae34 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -578,6 +578,10 @@ class BaseTest < ActiveSupport::TestCase
assert(mail1.to_s.to_i > mail2.to_s.to_i)
end
+ test 'default values which have to_proc (e.g. symbols) should not be considered procs' do
+ assert(ProcMailer.welcome['x-has-to-proc'].to_s == 'symbol')
+ end
+
test "we can call other defined methods on the class as needed" do
mail = ProcMailer.welcome
assert_equal("Thanks for signing up this afternoon", mail.subject)