diff options
author | Hongli Lai (Phusion) <hongli@phusion.nl> | 2008-12-03 19:30:35 +0100 |
---|---|---|
committer | Hongli Lai (Phusion) <hongli@phusion.nl> | 2008-12-03 19:30:35 +0100 |
commit | ccb96f2297e8783165cba764e9b5d51e1a15ff87 (patch) | |
tree | 3229e6fdddc42054615514d843c555e341003033 /actionpack/test/controller/test_test.rb | |
parent | fb2325e35855d62abd2c76ce03feaa3ca7992e4f (diff) | |
parent | 761a633a9c0a45d76ef3ed10da97e3696c3ded79 (diff) | |
download | rails-ccb96f2297e8783165cba764e9b5d51e1a15ff87.tar.gz rails-ccb96f2297e8783165cba764e9b5d51e1a15ff87.tar.bz2 rails-ccb96f2297e8783165cba764e9b5d51e1a15ff87.zip |
Merge commit 'origin/master' into savepoints
Conflicts:
activerecord/lib/active_record/fixtures.rb
activerecord/test/cases/defaults_test.rb
Diffstat (limited to 'actionpack/test/controller/test_test.rb')
-rw-r--r-- | actionpack/test/controller/test_test.rb | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index a23428804a..ee7b8ade8c 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -1,7 +1,7 @@ require 'abstract_unit' require 'controller/fake_controllers' -class TestTest < Test::Unit::TestCase +class TestTest < ActionController::TestCase class TestController < ActionController::Base def no_op render :text => 'dummy' @@ -24,7 +24,7 @@ class TestTest < Test::Unit::TestCase end def render_raw_post - raise Test::Unit::AssertionFailedError, "#raw_post is blank" if request.raw_post.blank? + raise ActiveSupport::TestCase::Assertion, "#raw_post is blank" if request.raw_post.blank? render :text => request.raw_post end @@ -580,7 +580,7 @@ XML assert_equal @response.redirect_url, redirect_to_url # Must be a :redirect response. - assert_raise(Test::Unit::AssertionFailedError) do + assert_raise(ActiveSupport::TestCase::Assertion) do assert_redirected_to 'created resource' end end @@ -602,21 +602,21 @@ XML end end -class CleanBacktraceTest < Test::Unit::TestCase +class CleanBacktraceTest < ActionController::TestCase def test_should_reraise_the_same_object - exception = Test::Unit::AssertionFailedError.new('message') + exception = ActiveSupport::TestCase::Assertion.new('message') clean_backtrace { raise exception } - rescue => caught + rescue Exception => caught assert_equal exception.object_id, caught.object_id assert_equal exception.message, caught.message end def test_should_clean_assertion_lines_from_backtrace path = File.expand_path("#{File.dirname(__FILE__)}/../../lib/action_controller") - exception = Test::Unit::AssertionFailedError.new('message') + exception = ActiveSupport::TestCase::Assertion.new('message') exception.set_backtrace ["#{path}/abc", "#{path}/assertions/def"] clean_backtrace { raise exception } - rescue => caught + rescue Exception => caught assert_equal ["#{path}/abc"], caught.backtrace end @@ -629,21 +629,17 @@ class CleanBacktraceTest < Test::Unit::TestCase end end -class InferringClassNameTest < Test::Unit::TestCase +class InferringClassNameTest < ActionController::TestCase def test_determine_controller_class assert_equal ContentController, determine_class("ContentControllerTest") end def test_determine_controller_class_with_nonsense_name - assert_raises ActionController::NonInferrableControllerError do - determine_class("HelloGoodBye") - end + assert_nil determine_class("HelloGoodBye") end def test_determine_controller_class_with_sensible_name_where_no_controller_exists - assert_raises ActionController::NonInferrableControllerError do - determine_class("NoControllerWithThisNameTest") - end + assert_nil determine_class("NoControllerWithThisNameTest") end private |