Commit aaebf94d by pierallard Committed by Jon Yurek

Syntax from Hound notes

parent ea142d80
...@@ -31,7 +31,7 @@ module Paperclip ...@@ -31,7 +31,7 @@ module Paperclip
end end
def mapping_override_mismatch? def mapping_override_mismatch?
! Array(mapped_content_type).include?(calculated_content_type) !Array(mapped_content_type).include?(calculated_content_type)
end end
def supplied_file_media_types def supplied_file_media_types
......
...@@ -44,11 +44,14 @@ describe Paperclip::MediaTypeSpoofDetector do ...@@ -44,11 +44,14 @@ describe Paperclip::MediaTypeSpoofDetector do
end end
end end
it 'doest allow array as :content_type_mappings' do it "does allow array as :content_type_mappings" do
begin begin
Paperclip.options[:content_type_mappings] = { html: [ "binary", "text/html" ] } Paperclip.options[:content_type_mappings] = {
html: [ "binary", "text/html" ]
}
file = File.open(fixture_file("empty.html")) file = File.open(fixture_file("empty.html"))
assert ! Paperclip::MediaTypeSpoofDetector.using(file, "empty.html").spoofed? assert !Paperclip::MediaTypeSpoofDetector
.using(file, "empty.html").spoofed?
ensure ensure
Paperclip.options[:content_type_mappings] = {} Paperclip.options[:content_type_mappings] = {}
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