Sha256: 57821825af36b26bff830404806c39dd064b969f383d3af534609e02060f73c4
Contents?: true
Size: 906 Bytes
Versions: 21
Compression:
Stored size: 906 Bytes
Contents
require 'test/helper' class UpfileTest < Test::Unit::TestCase { %w(jpg jpe jpeg) => 'image/jpeg', %w(tif tiff) => 'image/tiff', %w(png) => 'image/png', %w(gif) => 'image/gif', %w(bmp) => 'image/bmp', %w(txt) => 'text/plain', %w(htm html) => 'text/html', %w(csv) => 'text/csv', %w(xml) => 'text/xml', %w(css) => 'text/css', %w(js) => 'application/js', %w(foo) => 'application/x-foo' }.each do |extensions, content_type| extensions.each do |extension| should "return a content_type of #{content_type} for a file with extension .#{extension}" do file = stub('file', :path => "basename.#{extension}") class << file include Paperclip::Upfile end assert_equal content_type, file.content_type end end end end
Version data entries
21 entries across 21 versions & 11 rubygems