public
Description: Rails plugin for uploading images as resources, with support for resizing, text stamping, and other special effects.
Homepage: http://fleximage.rubyforge.org
Clone URL: git://github.com/Squeegy/fleximage.git
commit  137683d64d25c9b842ce95b4a5d842165e585810
tree    6c156b7f559df78a047207d6e738555119f1af2e
parent  9c53eb492d3cb333a089aa523b08e29c82836dfc
fleximage / test / unit / preprocess_image_option_test.rb
100644 22 lines (16 sloc) 0.568 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'test/test_helper'
 
class FleximagePreprocessImageOptionTest < Test::Unit::TestCase
  def test_should_resize_image_on_upload
    PhotoDb.preprocess_image do |image|
      image.resize '50x50', :crop => true
    end
    
    p = PhotoDb.new(:image_file => files(:photo))
    assert p.save, 'Record expected to be allowed to save'
    
    assert_equal 50, p.load_image.columns
    assert_equal 50, p.load_image.rows
    
    assert_equal 50, p.image_height
    assert_equal 50, p.image_width
    
  ensure
    PhotoDb.preprocess_image_operation = nil
  end
end