From a7af1e0051c5fae0a851a9c7f84892573639e5c5 Mon Sep 17 00:00:00 2001 From: David Chelimsky Date: Sat, 25 Jun 2011 12:41:06 -0500 Subject: Get the fixture_path from self.class instead of ActiveSupport::TestCase. This allows test classes that are not subclasses of ActiveSupport::TestCase (like those in rspec-rails) to interact with with this variable without having to reference ActiveSupport::TestCase. --- actionpack/lib/action_dispatch/testing/test_process.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/testing/test_process.rb b/actionpack/lib/action_dispatch/testing/test_process.rb index 367c295cf5..f668b81b45 100644 --- a/actionpack/lib/action_dispatch/testing/test_process.rb +++ b/actionpack/lib/action_dispatch/testing/test_process.rb @@ -39,7 +39,7 @@ module ActionDispatch # # post :change_avatar, :avatar => fixture_file_upload('/files/spongebob.png', 'image/png', :binary) def fixture_file_upload(path, mime_type = nil, binary = false) - fixture_path = ActionController::TestCase.send(:fixture_path) if ActionController::TestCase.respond_to?(:fixture_path) + fixture_path = self.class.fixture_path if self.class.respond_to?(:fixture_path) Rack::Test::UploadedFile.new("#{fixture_path}#{path}", mime_type, binary) end end -- cgit v1.2.3