summary refs log tree commit
path: root/test/spec_multipart.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec_multipart.rb')
-rw-r--r--test/spec_multipart.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/spec_multipart.rb b/test/spec_multipart.rb
index 2acb6e0d..01e0d814 100644
--- a/test/spec_multipart.rb
+++ b/test/spec_multipart.rb
@@ -153,6 +153,12 @@ describe Rack::Multipart do
     params["files"][:tempfile].read.should.equal "contents"
   end
 
+  should "preserve extension in the created tempfile" do
+    env = Rack::MockRequest.env_for("/", multipart_fixture(:text))
+    params = Rack::Multipart.parse_multipart(env)
+    File.extname(params["files"][:tempfile].path).should.equal ".txt"
+  end
+
   should "parse multipart upload with text file with no name field" do
     env = Rack::MockRequest.env_for("/", multipart_fixture(:filename_and_no_name))
     params = Rack::Multipart.parse_multipart(env)