Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added a test for reprocess\!

  • Loading branch information...
commit 25628d1307be31ae78d2e76f7f8e07425c6524f5 1 parent 4e9acd6
Jon Yurek jyurek authored

Showing 1 changed file with 31 additions and 0 deletions. Show diff stats Hide diff stats

  1. +31 0 test/test_integration.rb
31 test/test_integration.rb
@@ -18,6 +18,37 @@ class IntegrationTest < Test::Unit::TestCase
18 18 end
19 19 end
20 20
  21 + context "An attachment" do
  22 + setup do
  23 + rebuild_model :styles => { :thumb => "50x50#" }
  24 + @dummy = Dummy.new
  25 + @file = File.new(File.join(File.dirname(__FILE__),
  26 + "fixtures",
  27 + "5k.png"))
  28 + @dummy.avatar = @file
  29 + assert @dummy.save
  30 + end
  31 +
  32 + should "create its thumbnails properly" do
  33 + assert_match /\b50x50\b/, `identify '#{@dummy.avatar.path(:thumb)}'`
  34 + end
  35 +
  36 + context "redefining its attachment styles" do
  37 + setup do
  38 + Dummy.class_eval do
  39 + has_attached_file :avatar, :styles => { :thumb => "150x25#" }
  40 + end
  41 + @d2 = Dummy.find(@dummy.id)
  42 + @d2.avatar.reprocess!
  43 + @d2.save
  44 + end
  45 +
  46 + should "create its thumbnails properly" do
  47 + assert_match /\b150x25\b/, `identify '#{@dummy.avatar.path(:thumb)}'`
  48 + end
  49 + end
  50 + end
  51 +
21 52 context "A model with no attachment validation" do
22 53 setup do
23 54 rebuild_model :styles => { :large => "300x300>",

0 comments on commit 25628d1

Please sign in to comment.
Something went wrong with that request. Please try again.