added resizer

This commit is contained in:
albert
2010-02-08 01:40:39 -05:00
parent 3d70335d92
commit 9c441aff4c
24 changed files with 1715 additions and 341 deletions

View File

@@ -9,4 +9,20 @@ require 'rails/test_help'
Dir[File.expand_path(File.dirname(__FILE__) + "/factories/*.rb")].each {|file| require file}
class ActiveSupport::TestCase
protected
def upload_file(path, content_type, filename)
tempfile = Tempfile.new(filename)
FileUtils.copy_file(path, tempfile.path)
(class << tempfile; self; end).class_eval do
alias local_path path
define_method(:original_filename) {filename}
define_method(:content_type) {content_type}
end
tempfile
end
def upload_jpeg(path)
upload_file(path, "image/jpeg", File.basename(path))
end
end