Changeset 8497
- Timestamp:
- 12/28/07 05:21:24 (6 months ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/test_case.rb (modified) (1 diff)
- trunk/actionpack/test/controller/test_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r8485 r8497 1 1 *SVN* 2 3 * Ensure that test case setup is run even if overridden. #10382 [Josh Peek] 2 4 3 5 * Fix HTML Sanitizer to allow trailing spaces in CSS style attributes. Closes #10566 [wesley.moxam] trunk/actionpack/lib/action_controller/test_case.rb
r8283 r8497 45 45 end 46 46 47 def setup 47 def setup_with_controller 48 48 @controller = self.class.controller_class.new 49 49 @request = TestRequest.new 50 50 @response = TestResponse.new 51 51 end 52 end 52 alias_method :setup, :setup_with_controller 53 54 def self.method_added(method) 55 if method.to_s == 'setup' 56 unless method_defined?(:setup_without_controller) 57 alias_method :setup_without_controller, :setup 58 define_method(:setup) do 59 setup_with_controller 60 setup_without_controller 61 end 62 end 63 end 64 end 65 end 53 66 end trunk/actionpack/test/controller/test_test.rb
r8318 r8497 615 615 end 616 616 617 class ContentControllerTest < ActionController::TestCase 618 def setup 619 # Should not override ActionController setup methods 620 end 621 622 def test_should_still_setup_controller 623 assert_kind_of(ContentController, @controller) 624 end 625 end 626 617 627 class CrazyNameTest < ActionController::TestCase 618 628 tests ContentController … … 621 631 end 622 632 end 623