Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a test for reprocess\!

  • Loading branch information...
commit 25628d1307be31ae78d2e76f7f8e07425c6524f5 1 parent 4e9acd6
@jyurek jyurek authored
Showing with 31 additions and 0 deletions.
  1. +31 −0 test/test_integration.rb
View
31 test/test_integration.rb
@@ -18,6 +18,37 @@ class IntegrationTest < Test::Unit::TestCase
end
end
+ context "An attachment" do
+ setup do
+ rebuild_model :styles => { :thumb => "50x50#" }
+ @dummy = Dummy.new
+ @file = File.new(File.join(File.dirname(__FILE__),
+ "fixtures",
+ "5k.png"))
+ @dummy.avatar = @file
+ assert @dummy.save
+ end
+
+ should "create its thumbnails properly" do
+ assert_match /\b50x50\b/, `identify '#{@dummy.avatar.path(:thumb)}'`
+ end
+
+ context "redefining its attachment styles" do
+ setup do
+ Dummy.class_eval do
+ has_attached_file :avatar, :styles => { :thumb => "150x25#" }
+ end
+ @d2 = Dummy.find(@dummy.id)
+ @d2.avatar.reprocess!
+ @d2.save
+ end
+
+ should "create its thumbnails properly" do
+ assert_match /\b150x25\b/, `identify '#{@dummy.avatar.path(:thumb)}'`
+ end
+ end
+ end
+
context "A model with no attachment validation" do
setup do
rebuild_model :styles => { :large => "300x300>",
Please sign in to comment.
Something went wrong with that request. Please try again.