7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/test/processors/mini_magick_test.rb', line 7
def test_should_resize_image
attachment = upload_file :filename => '/files/rails.png'
assert_valid attachment
assert attachment.image?
assert_equal 43, attachment.width
assert_equal 55, attachment.height
thumb = attachment.thumbnails.detect { |t| t.filename =~ /_thumb/ }
geo = attachment.thumbnails.detect { |t| t.filename =~ /_geometry/ }
assert_equal 50, thumb.width
assert_equal 51, thumb.height
assert_equal 31, geo.width
assert_equal 40, geo.height
end
|