Sha256: 1888f2724be218fb8728db0550a6d26dd9518a7e9fdda7abe27feb98dc8e7456

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 KB

Contents

require File.dirname(__FILE__) + '/../../test/test_helper'

class FleximageMagicColumnsTest < Test::Unit::TestCase
  def test_should_save_data_in_magic_columns_from_local
    p = PhotoFile.create(:image_file => files(:photo))
    assert_equal 'photo.jpg', p.image_filename
    assert_equal 1024,  p.image_height
    assert_equal 768,   p.image_width
    assert_equal 'JPEG', p.image_format
    assert_equal 'jpg', p.extension
  end
  
  def test_should_save_data_in_magic_columns_from_url
    p = PhotoFile.create(:image_file_url => files(:web_photo))
    assert_equal files(:web_photo), p.image_filename
    assert_equal 110,   p.image_height
    assert_equal 276,   p.image_width
    assert_equal 'GIF', p.image_format
    assert_equal 'gif', p.extension
  rescue SocketError
    print '!'
  end
  
  def test_should_delete_magic_columns_when_image_is_deleted
    p = PhotoFile.new(:image_file => files(:photo))
    p.save
    
    p = PhotoFile.find(p.id)
    p.delete_image_file.save
    
    assert_nil p.image_width
    assert_nil p.image_height
  end
end

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
tvdeyen-fleximage-1.2.0 test/unit/magic_columns_test.rb
tvdeyen-fleximage-1.1.1 test/unit/magic_columns_test.rb
tvdeyen-fleximage-1.0.9 test/unit/magic_columns_test.rb
tvdeyen-fleximage-1.0.8 test/unit/magic_columns_test.rb
tvdeyen-fleximage-1.0.7 test/unit/magic_columns_test.rb
robinboening-fleximage-1.0.6 test/unit/magic_columns_test.rb
robinboening-fleximage-1.0.4 test/unit/magic_columns_test.rb
tvdeyen-fleximage-1.0.5 test/unit/magic_columns_test.rb
fleximage-1.0.4 test/unit/magic_columns_test.rb
dougmcbride-fleximage-1.0.3 test/unit/magic_columns_test.rb
fleximage-1.0.3 test/unit/magic_columns_test.rb
fleximage-1.0.2 test/unit/magic_columns_test.rb