aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-07-09 11:51:45 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-07-09 11:51:45 -0700
commit140d5a3b2f2131c7e7184f6792a3d94646c19cc0 (patch)
treec3534adecd3ec7105d276a555677a21ba35c5039 /actionpack/test/controller
parent394b7be0368cdf992b29c40bf7f501418d630b64 (diff)
downloadrails-140d5a3b2f2131c7e7184f6792a3d94646c19cc0.tar.gz
rails-140d5a3b2f2131c7e7184f6792a3d94646c19cc0.tar.bz2
rails-140d5a3b2f2131c7e7184f6792a3d94646c19cc0.zip
use `Rack::Test::UploadedFile` when uploading files
We should use rack-test's upload file objects on the test side so that we will be able to correctly generate mime blob posts in the future
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/test_case_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb
index de997bf954..b991232a14 100644
--- a/actionpack/test/controller/test_case_test.rb
+++ b/actionpack/test/controller/test_case_test.rb
@@ -908,7 +908,7 @@ XML
filename = 'mona_lisa.jpg'
path = "#{FILES_DIR}/#{filename}"
assert_deprecated {
- post :test_file_upload, file: ActionDispatch::Http::UploadedFile.new(filename: path, type: "image/jpg", tempfile: File.open(path))
+ post :test_file_upload, file: Rack::Test::UploadedFile.new(path, "image/jpg", true)
}
assert_equal '159528', @response.body
end
@@ -917,7 +917,7 @@ XML
filename = 'mona_lisa.jpg'
path = "#{FILES_DIR}/#{filename}"
post :test_file_upload, params: {
- file: ActionDispatch::Http::UploadedFile.new(filename: path, type: "image/jpg", tempfile: File.open(path))
+ file: Rack::Test::UploadedFile.new(path, "image/jpg", true)
}
assert_equal '159528', @response.body
end