Sha256: 0807798a25f69d5eabcabffd6a658fb44b1452b041a81106868a87a53ed26b9e

Contents?: true

Size: 744 Bytes

Versions: 1

Compression:

Stored size: 744 Bytes

Contents

require 'test_helper'

class ImagePresetsTest < ActiveSupport::TestCase
  include ActionDispatch::TestProcess

  setup :create_image

  test 'should save/destory main image and thumbs' do

    #assert_equal 58841, @record.image.size
    #assert_equal 89314, @record.image.size(:big)
    #assert_equal 12057, @record.image.size(:small)
    
    original = @record.image.realpath
    big = @record.image.realpath(:big)
    small = @record.image.realpath(:small)
    
    @record.destroy
   
    assert !File.exists?(original)
    assert !File.exists?(big)
    assert !File.exists?(small)

  end

  protected

  def create_image
    @record = ImageUpload.create :image => fixture_file_upload(::File.join('', 'image.jpg'), 'image/jpeg')
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_uploads-0.1.4 test/image_presets_test.rb