test/integration_test.rb in paperclip-2.3.16 vs test/integration_test.rb in paperclip-2.4.0

- old
+ new

@@ -281,9 +281,41 @@ assert_equal "-strip -depth 8", Dummy.attachment_definitions[:avatar][:convert_options] end end end + context "A model with no source_file_options setting" do + setup do + rebuild_model :styles => { :large => "300x300>", + :medium => "100x100", + :thumb => ["32x32#", :gif] }, + :default_style => :medium, + :url => "/:attachment/:class/:style/:id/:basename.:extension", + :path => ":rails_root/tmp/:attachment/:class/:style/:id/:basename.:extension" + @dummy = Dummy.new + end + + should "have its definition return nil when asked about source_file_options" do + assert ! Dummy.attachment_definitions[:avatar][:source_file_options] + end + + context "redefined to have source_file_options setting" do + setup do + rebuild_model :styles => { :large => "300x300>", + :medium => "100x100", + :thumb => ["32x32#", :gif] }, + :source_file_options => "-density 400", + :default_style => :medium, + :url => "/:attachment/:class/:style/:id/:basename.:extension", + :path => ":rails_root/tmp/:attachment/:class/:style/:id/:basename.:extension" + end + + should "have its definition return source_file_options value when asked about source_file_options" do + assert_equal "-density 400", Dummy.attachment_definitions[:avatar][:source_file_options] + end + end + end + context "A model with a filesystem attachment" do setup do rebuild_model :styles => { :large => "300x300>", :medium => "100x100", :thumb => ["32x32#", :gif] },