diff options
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 |