From a62e9e90d8f47a643c9355f782ab4891fa8fefaa Mon Sep 17 00:00:00 2001 From: Joel Chippindale Date: Tue, 11 Nov 2008 09:39:50 -0600 Subject: Fix for ActionMailer::Base.method_missing so that it raises NoMethodError when no method is found [#1330 state:resolved] Signed-off-by: Joshua Peek --- actionmailer/test/mail_service_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionmailer/test') diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index f5cb372b2a..8b1c9a8dca 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -1045,4 +1045,12 @@ class RespondToTest < Test::Unit::TestCase def test_should_not_respond_to_deliver_with_template_suffix_if_it_begins_with_a_digit assert !RespondToMailer.respond_to?(:deliver_1_template) end + + def test_should_still_raise_exception_with_expected_message_when_calling_an_undefined_method + error = assert_raises NoMethodError do + RespondToMailer.not_a_method + end + + assert_match /undefined method.*not_a_method/, error.message + end end -- cgit v1.2.3 From c65075feb6c4ce15582bc08411e6698d782249a7 Mon Sep 17 00:00:00 2001 From: Joel Chippindale Date: Tue, 11 Nov 2008 09:45:53 -0600 Subject: Fixed method_missing for ActionMailer so it no longer matches methods where deliver or create are not a suffix [#1318 state:resolved] Signed-off-by: Joshua Peek --- actionmailer/test/mail_service_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actionmailer/test') diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 8b1c9a8dca..b88beb3314 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -1046,6 +1046,10 @@ class RespondToTest < Test::Unit::TestCase assert !RespondToMailer.respond_to?(:deliver_1_template) end + def test_should_not_respond_to_method_where_deliver_is_not_a_suffix + assert !RespondToMailer.respond_to?(:foo_deliver_template) + end + def test_should_still_raise_exception_with_expected_message_when_calling_an_undefined_method error = assert_raises NoMethodError do RespondToMailer.not_a_method -- cgit v1.2.3 From e6b33a83376462619832fc51fb18929d4fc131db Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 15 Nov 2008 11:05:44 +0100 Subject: =?UTF-8?q?Added=20lambda=20merging=20to=20OptionMerger=20(especia?= =?UTF-8?q?lly=20useful=20with=20named=5Fscope=20and=20with=5Foptions)=20[?= =?UTF-8?q?#740=20state:commited]=20(Pawe=C5=82=20Kondzior)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actionmailer/test/mail_service_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionmailer/test') diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index b88beb3314..c49049cc6a 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -915,6 +915,8 @@ EOF def test_multipart_with_template_path_with_dots mail = FunkyPathMailer.create_multipart_with_template_path_with_dots(@recipient) assert_equal 2, mail.parts.length + assert_equal 'text/plain', mail.parts[0].content_type + assert_equal 'utf-8', mail.parts[0].charset end def test_custom_content_type_attributes -- cgit v1.2.3