diff options
author | Matthew Draper <matthew@trebex.net> | 2016-09-24 09:29:02 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-24 09:29:02 +0930 |
commit | 549ee51b771fa068a0c60896ea1f4d10747d50d2 (patch) | |
tree | 25ac2d41aa01436f9d82f32cc0751bcfed0521e6 /actionpack/lib/action_dispatch | |
parent | 4ce44fa0d73aa9fec6cc0b02f31ee972fde8acb1 (diff) | |
parent | e4fcc58529c9659b5d0d35479a9a6acf8edb9e36 (diff) | |
download | rails-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/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/test_process.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/testing/test_process.rb b/actionpack/lib/action_dispatch/testing/test_process.rb index 1456a0afcf..8b03b776fa 100644 --- a/actionpack/lib/action_dispatch/testing/test_process.rb +++ b/actionpack/lib/action_dispatch/testing/test_process.rb @@ -34,7 +34,8 @@ 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) - if self.class.respond_to?(:fixture_path) && self.class.fixture_path + if self.class.respond_to?(:fixture_path) && self.class.fixture_path && + !File.exist?(path) path = File.join(self.class.fixture_path, path) end Rack::Test::UploadedFile.new(path, mime_type, binary) |