diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-01-30 13:28:14 -0500 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-01-30 13:28:14 -0500 |
commit | 735aa635c5c70928583eeabc8bf4c5e3bc278f8b (patch) | |
tree | a8fa5bb304597b586b05c0b12f46653551fd2398 /actionmailer/test | |
parent | bfc69e873dba88024e9a79bb13569e096fb39255 (diff) | |
download | rails-735aa635c5c70928583eeabc8bf4c5e3bc278f8b.tar.gz rails-735aa635c5c70928583eeabc8bf4c5e3bc278f8b.tar.bz2 rails-735aa635c5c70928583eeabc8bf4c5e3bc278f8b.zip |
Implement respond_to_missing? in the Parameterized::Mailer class
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/parameterized_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionmailer/test/parameterized_test.rb b/actionmailer/test/parameterized_test.rb index f52945590b..fdfc20f785 100644 --- a/actionmailer/test/parameterized_test.rb +++ b/actionmailer/test/parameterized_test.rb @@ -38,4 +38,18 @@ class ParameterizedTest < ActiveSupport::TestCase @mail.deliver_later end end + + test "respond_to?" do + mailer = ParamsMailer.with(inviter: "david@basecamp.com", invitee: "jason@basecamp.com") + + assert_respond_to mailer, :invitation + assert_not_respond_to mailer, :anything + + invitation = mailer.method(:invitation) + assert_equal Method, invitation.class + + assert_raises(NameError) do + invitation = mailer.method(:anything) + end + end end |