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/test/controller/test_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/test_test.rb b/actionpack/test/controller/test_test.rb index 6265e78030..043d44500a 100644 --- a/actionpack/test/controller/test_test.rb +++ b/actionpack/test/controller/test_test.rb @@ -649,6 +649,13 @@ XML end + def test_fixture_path_is_accessed_from_self_instead_of_active_support_test_case + TestTest.stubs(:fixture_path).returns(FILES_DIR) + + uploaded_file = fixture_file_upload('/mona_lisa.jpg', 'image/png') + assert_equal File.open("#{FILES_DIR}/mona_lisa.jpg", READ_PLAIN).read, uploaded_file.read + end + def test_test_uploaded_file_with_binary filename = 'mona_lisa.jpg' path = "#{FILES_DIR}/#{filename}" -- cgit v1.2.3