diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-20 13:47:11 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-20 13:47:36 -0800 |
commit | ebdbd854a92ff0594c9af53432d70de882b1c7d1 (patch) | |
tree | afe4d65dc52f16292d7f9f8cea95b5df0898c26d /actionpack/lib | |
parent | b7a5ffd08342da133c4fbf0c15a895c1608fbdbb (diff) | |
download | rails-ebdbd854a92ff0594c9af53432d70de882b1c7d1.tar.gz rails-ebdbd854a92ff0594c9af53432d70de882b1c7d1.tar.bz2 rails-ebdbd854a92ff0594c9af53432d70de882b1c7d1.zip |
Fix straggling references to Test::Unit::TestCase
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/test_process.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb index 28fb148e6e..3aceb20814 100644 --- a/actionpack/lib/action_controller/test_process.rb +++ b/actionpack/lib/action_controller/test_process.rb @@ -332,10 +332,10 @@ module ActionController #:nodoc: # 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 @@ module ActionController #:nodoc: 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 @@ module ActionController #:nodoc: # # 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. |