diff options
Diffstat (limited to 'actionpack/test/controller/test_test.rb')
-rw-r--r-- | actionpack/test/controller/test_test.rb | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index b624005a57..58d9ca537f 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -64,7 +64,7 @@ class TestTest < Test::Unit::TestCase </html> HTML end - + def test_xml_output response.content_type = "application/xml" render :text => <<XML @@ -117,8 +117,8 @@ XML @controller = TestController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new - ActionController::Routing::Routes.reload ActionController::Routing.use_controllers! %w(content admin/user test_test/test) + ActionController::Routing::Routes.load_routes! end def teardown @@ -366,7 +366,7 @@ XML :children => { :count => 1, :only => { :tag => "img" } } } } end - + def test_should_not_impose_childless_html_tags_in_xml process :test_xml_output @@ -412,7 +412,7 @@ XML def test_assert_routing_with_method with_routing do |set| - set.draw { |map| map.resources(:content) } + set.draw { |map| map.resources(:content) } assert_routing({ :method => 'post', :path => 'content' }, { :controller => 'content', :action => 'create' }) end end @@ -486,7 +486,7 @@ XML assert_nil @request.env['HTTP_X_REQUESTED_WITH'] end - def test_header_properly_reset_after_get_request + def test_header_properly_reset_after_get_request get :test_params @request.recycle! assert_nil @request.instance_variable_get("@request_method") @@ -532,15 +532,15 @@ XML assert_equal file.path, file.local_path assert_equal expected, file.read end - + def test_test_uploaded_file_with_binary filename = 'mona_lisa.jpg' path = "#{FILES_DIR}/#{filename}" content_type = 'image/png' - + binary_uploaded_file = ActionController::TestUploadedFile.new(path, content_type, :binary) assert_equal File.open(path, READ_BINARY).read, binary_uploaded_file.read - + plain_uploaded_file = ActionController::TestUploadedFile.new(path, content_type) assert_equal File.open(path, READ_PLAIN).read, plain_uploaded_file.read end @@ -549,10 +549,10 @@ XML filename = 'mona_lisa.jpg' path = "#{FILES_DIR}/#{filename}" content_type = 'image/jpg' - + binary_file_upload = fixture_file_upload(path, content_type, :binary) assert_equal File.open(path, READ_BINARY).read, binary_file_upload.read - + plain_file_upload = fixture_file_upload(path, content_type) assert_equal File.open(path, READ_PLAIN).read, plain_file_upload.read end @@ -584,7 +584,7 @@ XML get :test_send_file assert_nothing_raised(NoMethodError) { @response.binary_content } end - + protected def with_foo_routing with_routing do |set| @@ -597,7 +597,6 @@ XML end end - class CleanBacktraceTest < Test::Unit::TestCase def test_should_reraise_the_same_object exception = Test::Unit::AssertionFailedError.new('message') @@ -658,7 +657,7 @@ end class NamedRoutesControllerTest < ActionController::TestCase tests ContentController - + def test_should_be_able_to_use_named_routes_before_a_request_is_done with_routing do |set| set.draw { |map| map.resources :contents } |