Commit 53f9558a by jyurek

Tweaks

git-svn-id: https://svn.thoughtbot.com/plugins/paperclip/trunk@299 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
parent 9412f71b
......@@ -34,11 +34,10 @@ module Paperclip
self.original_file_size = uploaded_file.size
self[:original] = uploaded_file.read
@dirty = true
@delete_on_save = false
if definition.content_type == :image
convert( self[:original] )
end
end
def [](style) #:nodoc:
@files[style]
......
......@@ -5,9 +5,12 @@ class TestPaperclip < Test::Unit::TestCase
context "Paperclip" do
should "allow overriding options" do
not_expected = Paperclip.options[:image_magick_path]
Paperclip.options[:image_magick_path] = "123"
assert_equal "123", Paperclip.options[:image_magick_path]
[:image_magick_path, :whiny_deletes, :whiny_thumbnails].each do |option|
not_expected = Paperclip.options[option]
Paperclip.options[option] = "123"
assert_equal "123", Paperclip.options[option]
assert_not_equal not_expected, Paperclip.options[option]
end
end
should "give the correct path for a command" do
......@@ -20,9 +23,10 @@ class TestPaperclip < Test::Unit::TestCase
assert_equal expected, Paperclip.path_for_command("wtf")
end
context "being used on class Improper" do
context "being used on improper class Improper" do
setup do
ActiveRecord::Base.connection.create_table :impropers, :force => true do |table|
# Empty table
end
Object.send(:remove_const, :Improper) rescue nil
class ::Improper < ActiveRecord::Base; 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