aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/test_case_test.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-09-24 09:29:02 +0930
committerGitHub <noreply@github.com>2016-09-24 09:29:02 +0930
commit549ee51b771fa068a0c60896ea1f4d10747d50d2 (patch)
tree25ac2d41aa01436f9d82f32cc0751bcfed0521e6 /actionpack/test/controller/test_case_test.rb
parent4ce44fa0d73aa9fec6cc0b02f31ee972fde8acb1 (diff)
parente4fcc58529c9659b5d0d35479a9a6acf8edb9e36 (diff)
downloadrails-549ee51b771fa068a0c60896ea1f4d10747d50d2.tar.gz
rails-549ee51b771fa068a0c60896ea1f4d10747d50d2.tar.bz2
rails-549ee51b771fa068a0c60896ea1f4d10747d50d2.zip
Merge pull request #26607 from matthewd/skip-fixture-path
Only search fixture_path for files that can't be found directly
Diffstat (limited to 'actionpack/test/controller/test_case_test.rb')
-rw-r--r--actionpack/test/controller/test_case_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb
index 696794a3eb..738d8bab6d 100644
--- a/actionpack/test/controller/test_case_test.rb
+++ b/actionpack/test/controller/test_case_test.rb
@@ -962,6 +962,13 @@ XML
end
end
+ def test_fixture_file_upload_ignores_fixture_path_given_full_path
+ TestCaseTest.stub :fixture_path, File.dirname(__FILE__) do
+ uploaded_file = fixture_file_upload("#{FILES_DIR}/mona_lisa.jpg", "image/jpg")
+ assert_equal File.open("#{FILES_DIR}/mona_lisa.jpg", READ_PLAIN).read, uploaded_file.read
+ end
+ end
+
def test_fixture_file_upload_ignores_nil_fixture_path
uploaded_file = fixture_file_upload("#{FILES_DIR}/mona_lisa.jpg", "image/jpg")
assert_equal File.open("#{FILES_DIR}/mona_lisa.jpg", READ_PLAIN).read, uploaded_file.read