Commit 16f707ec by Ylan Segal Committed by Jon Yurek

Bringing back functionality to allow StringioAdapter to accept content_type and original_filename

parent 9fc74e07
...@@ -6,6 +6,7 @@ module Paperclip ...@@ -6,6 +6,7 @@ module Paperclip
@tempfile = copy_to_tempfile(@target) @tempfile = copy_to_tempfile(@target)
end end
attr_writer :original_filename, :content_type
private private
def cache_current_values def cache_current_values
......
...@@ -36,6 +36,16 @@ class StringioFileProxyTest < Test::Unit::TestCase ...@@ -36,6 +36,16 @@ class StringioFileProxyTest < Test::Unit::TestCase
should "return the data contained in the StringIO" do should "return the data contained in the StringIO" do
assert_equal "abc123", @subject.read assert_equal "abc123", @subject.read
end end
should 'accept a content_type' do
@subject.content_type = 'image/png'
assert_equal 'image/png', @subject.content_type
end
should 'accept an orgiginal_filename' do
@subject.original_filename = 'image.png'
assert_equal 'image.png', @subject.original_filename
end
end end
end 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