Sha256: e6b16dc40246314ac6277e8281fb63a1ee6390195ae711e3620c8e0f1baf880f

Contents?: true

Size: 755 Bytes

Versions: 10

Compression:

Stored size: 755 Bytes

Contents

require 'test_helper'

class LocalImagePresetsTest < ActiveSupport::TestCase

  setup do
    @record = ImageUpload.create(:image => fixture_file_upload('/image.jpg', 'image/jpeg'))
  end

  test "should save/destory main image and thumbs" do
    original = Rails.root.join('tmp', 'uploads', 'images', 'original', @record.image.filename)
    big = Rails.root.join('tmp', 'uploads', 'images', 'big', @record.image.filename)
    small = Rails.root.join('tmp', 'uploads', 'images', 'small', @record.image.filename)

    assert ::File.exists?(original)
    assert ::File.exists?(big)
    assert ::File.exists?(small)
    
    @record.destroy
   
    assert !::File.exists?(original)
    assert !::File.exists?(big)
    assert !::File.exists?(small)
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rails_uploads-0.2.9 test/unit/local_image_record_test.rb
rails_uploads-0.2.8 test/unit/local_image_record_test.rb
rails_uploads-0.2.7 test/unit/local_image_record_test.rb
rails_uploads-0.2.6 test/unit/local_image_record_test.rb
rails_uploads-0.2.5 test/unit/local_image_record_test.rb
rails_uploads-0.2.4 test/unit/local_image_record_test.rb
rails_uploads-0.2.3 test/unit/local_image_record_test.rb
rails_uploads-0.2.2 test/unit/local_image_record_test.rb
rails_uploads-0.2.1 test/unit/local_image_record_test.rb
rails_uploads-0.2.0 test/unit/local_image_record_test.rb