Commit 67281668 by Prem Sichanugrist

Make sure no newline from type_from_file_command

This relates to #817
parent 7332e51a
......@@ -27,6 +27,5 @@ module Paperclip
mime_type = "application/x-#{type}" if mime_type.match(/\(.*?\)/)
mime_type
end
end
end
require './test/helper'
class AbstractAdapterTest < Test::Unit::TestCase
class TestAdapter < Paperclip::AbstractAdapter
attr_accessor :path, :original_file_name
def content_type
type_from_file_command
end
end
context "content type from file command" do
setup do
Paperclip.stubs(:run).returns("image/png\n")
end
should "return the content type without newline" do
assert_equal "image/png", TestAdapter.new.content_type
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