Commit d71cc2dd by djcp

Ensure the handle is closed after using OpenURI to get a remote file

parent 7e6b5b6f
......@@ -32,6 +32,7 @@ module Paperclip
while data = src.read(16*1024)
destination.write(data)
end
src.close
destination.rewind
destination
end
......
......@@ -14,6 +14,10 @@ class UriProxyTest < Test::Unit::TestCase
assert_equal "thoughtbot-logo.png", @subject.original_filename
end
should 'close open handle after reading' do
assert_equal true, @open_return.closed?
end
should "return a content type" do
assert_equal "image/png", @subject.content_type
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment