aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/uploaded_file_test.rb
diff options
context:
space:
mode:
authorsepehr500 <sepehr411@gmail.com>2017-05-12 14:43:34 -0400
committersepehr500 <sepehr411@gmail.com>2017-05-15 20:54:13 -0400
commitbfbbb1207930e7ebe56d4a99abd53b2aa66e0b6e (patch)
tree7fe7bc813c4a7443b9929d36a12ac92fb4eda0b7 /actionpack/test/dispatch/uploaded_file_test.rb
parent661f537b15026a35234db8a7b9386b4335198a8a (diff)
downloadrails-bfbbb1207930e7ebe56d4a99abd53b2aa66e0b6e.tar.gz
rails-bfbbb1207930e7ebe56d4a99abd53b2aa66e0b6e.tar.bz2
rails-bfbbb1207930e7ebe56d4a99abd53b2aa66e0b6e.zip
Fixed string being modified in place causing frozen string errors in Ruby 2.3
Diffstat (limited to 'actionpack/test/dispatch/uploaded_file_test.rb')
-rw-r--r--actionpack/test/dispatch/uploaded_file_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/uploaded_file_test.rb b/actionpack/test/dispatch/uploaded_file_test.rb
index 51680216e4..0074d2a314 100644
--- a/actionpack/test/dispatch/uploaded_file_test.rb
+++ b/actionpack/test/dispatch/uploaded_file_test.rb
@@ -13,6 +13,12 @@ module ActionDispatch
assert_equal "foo", uf.original_filename
end
+ def test_filename_is_different_object
+ file_str = "foo"
+ uf = Http::UploadedFile.new(filename: file_str, tempfile: Object.new)
+ assert_not_equal file_str.object_id , uf.original_filename.object_id
+ end
+
def test_filename_should_be_in_utf_8
uf = Http::UploadedFile.new(filename: "foo", tempfile: Object.new)
assert_equal "UTF-8", uf.original_filename.encoding.to_s