Commit 3d814fb3 by Prem Sichanugrist

Add test for the return of `file` command in *nix

parent 9ddfc6a1
...@@ -59,6 +59,17 @@ class FileAdapterTest < Test::Unit::TestCase ...@@ -59,6 +59,17 @@ class FileAdapterTest < Test::Unit::TestCase
assert_kind_of String, @subject.content_type assert_kind_of String, @subject.content_type
end end
end end
context "file with content type derived from file command on *nix" do
setup do
MIME::Types.stubs(:type_for).returns([])
Paperclip.stubs(:run).returns("application/vnd.ms-office\n")
end
should "return content type without newline character" do
assert_equal "application/vnd.ms-office", @subject.content_type
end
end
end end
context "empty file" do context "empty file" do
......
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