From cd9ffd11e13ef6e62eba2cbd5c3760ff04132820 Mon Sep 17 00:00:00 2001 From: wycats Date: Tue, 16 Mar 2010 23:24:00 -0700 Subject: Eliminate warnings for AM on 1.8 --- actionmailer/test/old_base/url_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionmailer/test/old_base') diff --git a/actionmailer/test/old_base/url_test.rb b/actionmailer/test/old_base/url_test.rb index 60740d6b0b..c98c3cde3a 100644 --- a/actionmailer/test/old_base/url_test.rb +++ b/actionmailer/test/old_base/url_test.rb @@ -31,6 +31,8 @@ class TestMailer < ActionMailer::Base attr_accessor :received_body end + remove_method :receive + def receive(mail) self.class.received_body = mail.body end -- cgit v1.2.3 From a5587efc1903fd27d4b179753aa6e139445ad18c Mon Sep 17 00:00:00 2001 From: wycats Date: Wed, 17 Mar 2010 00:15:55 -0700 Subject: Remove some 1.9 warnings (resulting in some fixed bugs). Remaining AM warnings are in dependencies. --- actionmailer/test/old_base/url_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionmailer/test/old_base') diff --git a/actionmailer/test/old_base/url_test.rb b/actionmailer/test/old_base/url_test.rb index c98c3cde3a..c09e05f942 100644 --- a/actionmailer/test/old_base/url_test.rb +++ b/actionmailer/test/old_base/url_test.rb @@ -28,6 +28,8 @@ class TestMailer < ActionMailer::Base end class < Date: Wed, 17 Mar 2010 21:43:01 -0700 Subject: Kill nonexistent method removal --- actionmailer/test/old_base/url_test.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'actionmailer/test/old_base') diff --git a/actionmailer/test/old_base/url_test.rb b/actionmailer/test/old_base/url_test.rb index c09e05f942..c98c3cde3a 100644 --- a/actionmailer/test/old_base/url_test.rb +++ b/actionmailer/test/old_base/url_test.rb @@ -28,8 +28,6 @@ class TestMailer < ActionMailer::Base end class < Date: Wed, 17 Mar 2010 22:27:34 -0700 Subject: Fix broken test due to constant collision --- actionmailer/test/old_base/url_test.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'actionmailer/test/old_base') diff --git a/actionmailer/test/old_base/url_test.rb b/actionmailer/test/old_base/url_test.rb index c98c3cde3a..0b8bef233b 100644 --- a/actionmailer/test/old_base/url_test.rb +++ b/actionmailer/test/old_base/url_test.rb @@ -10,7 +10,7 @@ class ActionMailer::Base include AppRoutes.url_helpers end -class TestMailer < ActionMailer::Base +class UrlTestMailer < ActionMailer::Base default_url_options[:host] = 'www.basecamphq.com' configure do |c| @@ -31,8 +31,6 @@ class TestMailer < ActionMailer::Base attr_accessor :received_body end - remove_method :receive - def receive(mail) self.class.received_body = mail.body end @@ -67,7 +65,7 @@ class ActionMailerUrlTest < Test::Unit::TestCase end def test_signed_up_with_url - TestMailer.delivery_method = :test + UrlTestMailer.delivery_method = :test AppRoutes.draw do |map| map.connect ':controller/:action/:id' @@ -82,14 +80,14 @@ class ActionMailerUrlTest < Test::Unit::TestCase expected.date = Time.local(2004, 12, 12) created = nil - assert_nothing_raised { created = TestMailer.signed_up_with_url(@recipient) } + assert_nothing_raised { created = UrlTestMailer.signed_up_with_url(@recipient) } assert_not_nil created expected.message_id = '<123@456>' created.message_id = '<123@456>' assert_equal expected.encoded, created.encoded - assert_nothing_raised { TestMailer.signed_up_with_url(@recipient).deliver } + assert_nothing_raised { UrlTestMailer.signed_up_with_url(@recipient).deliver } assert_not_nil ActionMailer::Base.deliveries.first delivered = ActionMailer::Base.deliveries.first -- cgit v1.2.3 From 9da153c2d39f52c55af59a42b8551763b5821900 Mon Sep 17 00:00:00 2001 From: Carlhuda Date: Thu, 18 Mar 2010 11:30:31 -0700 Subject: Fix an error in isolated running of tests --- actionmailer/test/old_base/url_test.rb | 8 -------- 1 file changed, 8 deletions(-) (limited to 'actionmailer/test/old_base') diff --git a/actionmailer/test/old_base/url_test.rb b/actionmailer/test/old_base/url_test.rb index 0b8bef233b..17b383cc2a 100644 --- a/actionmailer/test/old_base/url_test.rb +++ b/actionmailer/test/old_base/url_test.rb @@ -26,14 +26,6 @@ class UrlTestMailer < ActionMailer::Base @recipient = recipient @welcome_url = url_for :host => "example.com", :controller => "welcome", :action => "greeting" end - - class < Date: Fri, 19 Mar 2010 17:20:15 +0100 Subject: Improve performance of the rendering stack by freezing formats as a sign that they shouldn't be further modified. --- actionmailer/test/old_base/mail_layout_test.rb | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'actionmailer/test/old_base') diff --git a/actionmailer/test/old_base/mail_layout_test.rb b/actionmailer/test/old_base/mail_layout_test.rb index 5679aa5a64..2c2daa0f28 100644 --- a/actionmailer/test/old_base/mail_layout_test.rb +++ b/actionmailer/test/old_base/mail_layout_test.rb @@ -69,47 +69,25 @@ class LayoutMailerTest < Test::Unit::TestCase def test_should_pickup_multipart_layout mail = AutoLayoutMailer.multipart - # CHANGED: content_type returns an object - # assert_equal "multipart/alternative", mail.content_type assert_equal "multipart/alternative", mail.mime_type assert_equal 2, mail.parts.size - # CHANGED: content_type returns an object - # assert_equal 'text/plain', mail.parts.first.content_type assert_equal 'text/plain', mail.parts.first.mime_type - - # CHANGED: body returns an object - # assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body.to_s - # CHANGED: content_type returns an object - # assert_equal 'text/html', mail.parts.last.content_type assert_equal 'text/html', mail.parts.last.mime_type - - # CHANGED: body returns an object - # assert_equal "Hello from layout text/html multipart", mail.parts.last.body assert_equal "Hello from layout text/html multipart", mail.parts.last.body.to_s end def test_should_pickup_multipartmixed_layout mail = AutoLayoutMailer.multipart("multipart/mixed") - # CHANGED: content_type returns an object - # assert_equal "multipart/mixed", mail.content_type assert_equal "multipart/mixed", mail.mime_type assert_equal 2, mail.parts.size - # CHANGED: content_type returns an object - # assert_equal 'text/plain', mail.parts.first.content_type assert_equal 'text/plain', mail.parts.first.mime_type - # CHANGED: body returns an object - # assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body.to_s - # CHANGED: content_type returns an object - # assert_equal 'text/html', mail.parts.last.content_type assert_equal 'text/html', mail.parts.last.mime_type - # CHANGED: body returns an object - # assert_equal "Hello from layout text/html multipart", mail.parts.last.body assert_equal "Hello from layout text/html multipart", mail.parts.last.body.to_s end -- cgit v1.2.3 From 1e4be20672252ac15a355589dd44bdd4623640c4 Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Mon, 22 Mar 2010 09:50:45 -0700 Subject: Fix ActionMailer test issues * Don't depend so much no the message in a NameError * Reset the delivery method properly --- actionmailer/test/old_base/mail_service_test.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'actionmailer/test/old_base') diff --git a/actionmailer/test/old_base/mail_service_test.rb b/actionmailer/test/old_base/mail_service_test.rb index 6d0b2c53a3..e49307bfda 100644 --- a/actionmailer/test/old_base/mail_service_test.rb +++ b/actionmailer/test/old_base/mail_service_test.rb @@ -340,6 +340,8 @@ class ActionMailerTest < Test::Unit::TestCase @original_logger = TestMailer.logger @recipient = 'test@localhost' + + TestMailer.delivery_method = :test end def teardown @@ -1191,6 +1193,6 @@ class RespondToTest < Test::Unit::TestCase RespondToMailer.not_a_method end - assert_match(/undefined method.*not_a_method/, error.message) + assert_match(/method.*not_a_method/, error.message) end -end \ No newline at end of file +end -- cgit v1.2.3