public
Description: Paperclip File Management Plugin
Homepage: http://www.thoughtbot.com/projects/paperclip
Clone URL: git://github.com/thoughtbot/paperclip.git
Search Repo:
Added a test for reprocess\!
jyurek (author)
Tue May 13 10:50:35 -0700 2008
commit  25628d1307be31ae78d2e76f7f8e07425c6524f5
tree    b2f1b27d31c77f44b60eca9888eee8cd62774eed
parent  4e9acd69ef832d42df7d921b00843182d8883fc4
...
18
19
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
22
23
...
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
0
@@ -18,6 +18,37 @@
0
     end
0
   end
0
 
0
+ context "An attachment" do
0
+ setup do
0
+ rebuild_model :styles => { :thumb => "50x50#" }
0
+ @dummy = Dummy.new
0
+ @file = File.new(File.join(File.dirname(__FILE__),
0
+ "fixtures",
0
+ "5k.png"))
0
+ @dummy.avatar = @file
0
+ assert @dummy.save
0
+ end
0
+
0
+ should "create its thumbnails properly" do
0
+ assert_match /\b50x50\b/, `identify '#{@dummy.avatar.path(:thumb)}'`
0
+ end
0
+
0
+ context "redefining its attachment styles" do
0
+ setup do
0
+ Dummy.class_eval do
0
+ has_attached_file :avatar, :styles => { :thumb => "150x25#" }
0
+ end
0
+ @d2 = Dummy.find(@dummy.id)
0
+ @d2.avatar.reprocess!
0
+ @d2.save
0
+ end
0
+
0
+ should "create its thumbnails properly" do
0
+ assert_match /\b150x25\b/, `identify '#{@dummy.avatar.path(:thumb)}'`
0
+ end
0
+ end
0
+ end
0
+
0
   context "A model with no attachment validation" do
0
     setup do
0
       rebuild_model :styles => { :large => "300x300>",

Comments

    No one has commented yet.