test/unit/attachment_test.rb in dynamic_paperclip-1.0.0a.2 vs test/unit/attachment_test.rb in dynamic_paperclip-1.0.0a.3
- old
+ new
@@ -36,6 +36,19 @@
attachment.process_dynamic_style :dynamic_42x42
assert_equal '42x42', attachment.styles[:dynamic_42x42].geometry
end
+
+ should 'delete styles passed to #delete_styles and maintain existing delete queued' do
+ attachment = photos(:rails).image
+
+ attachment.instance_variable_set :@queued_for_delete, [:thumb]
+
+ attachment.expects(:queue_some_for_delete).with(:foo, :bar)
+ attachment.expects(:flush_deletes)
+
+ attachment.delete_styles :foo, :bar
+
+ assert_equal [:thumb], attachment.instance_variable_get(:@queued_for_delete)
+ end
end
\ No newline at end of file