Sha256: 70fe608d34fb9a97c0163ac72fb192341db84e94e4e9e0dd67db35329d4bc9ab

Contents?: true

Size: 558 Bytes

Versions: 4

Compression:

Stored size: 558 Bytes

Contents

require 'test_helper'
 
class LocalGenerateTest < ActionDispatch::IntegrationTest

  setup do
    @image = Attachs::Types::Image.new(fixture_file_upload('/image.jpg', 'image/jpeg'))
    @image.store
  end

  teardown do
    @image.delete
  end

  test "should generate preset" do
    realpath = Rails.root.join('tmp', 'uploads', 'images', 'small', @image.filename)
    ::File.delete realpath

    path = ::File.join('', 'uploads', 'images', 'small', @image.filename)
    get path
    assert_redirected_to path

    assert ::File.exists?(realpath)
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
attachs-0.3.5 test/local_generate_test.rb
attachs-0.3.2 test/local_generate_test.rb
attachs-0.3.1 test/local_generate_test.rb
attachs-0.3.0 test/local_generate_test.rb