Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix straggling references to Test::Unit::TestCase

  • Loading branch information...
commit ebdbd854a92ff0594c9af53432d70de882b1c7d1 1 parent b7a5ffd
@jeremy jeremy authored
Showing with 4 additions and 8 deletions.
  1. +4 −8 actionpack/lib/action_controller/test_process.rb
View
12 actionpack/lib/action_controller/test_process.rb
@@ -332,10 +332,10 @@ def close
# a file upload.
#
# Usage example, within a functional test:
- # post :change_avatar, :avatar => ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + '/files/spongebob.png', 'image/png')
+ # post :change_avatar, :avatar => ActionController::TestUploadedFile.new(ActionController::TestCase.fixture_path + '/files/spongebob.png', 'image/png')
#
# Pass a true third parameter to ensure the uploaded file is opened in binary mode (only required for Windows):
- # post :change_avatar, :avatar => ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + '/files/spongebob.png', 'image/png', :binary)
+ # post :change_avatar, :avatar => ActionController::TestUploadedFile.new(ActionController::TestCase.fixture_path + '/files/spongebob.png', 'image/png', :binary)
require 'tempfile'
class TestUploadedFile
# The filename, *not* including the path, of the "uploaded" file
@@ -471,7 +471,7 @@ def method_missing(selector, *args, &block)
end
end
- # Shortcut for <tt>ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + path, type)</tt>:
+ # Shortcut for <tt>ActionController::TestUploadedFile.new(ActionController::TestCase.fixture_path + path, type)</tt>:
#
# post :change_avatar, :avatar => fixture_file_upload('/files/spongebob.png', 'image/png')
#
@@ -480,11 +480,7 @@ def method_missing(selector, *args, &block)
#
# post :change_avatar, :avatar => fixture_file_upload('/files/spongebob.png', 'image/png', :binary)
def fixture_file_upload(path, mime_type = nil, binary = false)
- ActionController::TestUploadedFile.new(
- Test::Unit::TestCase.respond_to?(:fixture_path) ? Test::Unit::TestCase.fixture_path + path : path,
- mime_type,
- binary
- )
+ ActionController::TestUploadedFile.new("#{ActionController::TestCase.try(:fixture_path)}#{path}", mime_type, binary)
end
# A helper to make it easier to test different route configurations.
Please sign in to comment.
Something went wrong with that request. Please try again.