Changeset 8536
- Timestamp:
- 01/03/08 00:40:28 (1 year ago)
- Files:
-
- trunk/actionmailer/CHANGELOG (modified) (1 diff)
- trunk/actionmailer/lib/action_mailer/test_case.rb (modified) (2 diffs)
- trunk/actionmailer/test/test_helper_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionmailer/CHANGELOG
r8419 r8536 1 *SVN* 2 3 * Fixed that you don't have to call super in ActionMailer::TestCase#setup #10406 [jamesgolick] 4 5 1 6 *2.0.2* (December 16th, 2007) 2 7 trunk/actionmailer/lib/action_mailer/test_case.rb
r8173 r8536 34 34 end 35 35 36 def setup 36 def setup_with_mailer 37 37 ActionMailer::Base.delivery_method = :test 38 38 ActionMailer::Base.perform_deliveries = true … … 42 42 @expected.set_content_type "text", "plain", { "charset" => charset } 43 43 @expected.mime_version = '1.0' 44 end 45 alias_method :setup, :setup_with_mailer 46 47 def self.method_added(method) 48 if method.to_s == 'setup' 49 unless method_defined?(:setup_without_mailer) 50 alias_method :setup_without_mailer, :setup 51 define_method(:setup) do 52 setup_with_mailer 53 setup_without_mailer 54 end 55 end 56 end 44 57 end 45 58 trunk/actionmailer/test/test_helper_test.rb
r8022 r8536 116 116 end 117 117 end 118 119 class AnotherTestHelperMailerTest < ActionMailer::TestCase 120 121 tests TestHelperMailer 122 123 def setup 124 # Should not override ActionMailer setup methods 125 @test_var = "a value" 126 end 127 128 def test_should_still_setup_mailer 129 assert @expected.is_a?(TMail::Mail) 130 end 131 132 def test_should_run_overridden_setup_method 133 assert @test_var 134 end 135 end