aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-01-13 03:28:32 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-01-13 03:28:32 +0000
commit5339f813be99012aba01586743d8b24f065e7034 (patch)
treef0d575c3e55f0c22af6d36230a53ada30da6ba23 /actionpack
parent296ca4da1700eb27a7043112d22027444ea0e548 (diff)
downloadrails-5339f813be99012aba01586743d8b24f065e7034.tar.gz
rails-5339f813be99012aba01586743d8b24f065e7034.tar.bz2
rails-5339f813be99012aba01586743d8b24f065e7034.zip
Change Object#try to raise NoMethodError on private methods and always return nil when Object is nil [Pratik Naik, Lawrence Pit]
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/test_process.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb
index 8180d4ee93..22b97fc157 100644
--- a/actionpack/lib/action_controller/test_process.rb
+++ b/actionpack/lib/action_controller/test_process.rb
@@ -484,7 +484,8 @@ 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("#{ActionController::TestCase.try(:fixture_path)}#{path}", mime_type, binary)
+ fixture_path = ActionController::TestCase.send(:fixture_path) if ActionController::TestCase.respond_to?(:fixture_path)
+ ActionController::TestUploadedFile.new("#{fixture_path}#{path}", mime_type, binary)
end
# A helper to make it easier to test different route configurations.