Sha256: 2f214d35112dfe9cda7dd9bf8e5a665cfa81687300d483501da9882c41da18cf

Contents?: true

Size: 794 Bytes

Versions: 14

Compression:

Stored size: 794 Bytes

Contents

require File.expand_path('../test_helper', __FILE__)

class ImgTest < UnitTest
  Image = Sinatra::AssetPack::Image

  test "get img" do
    get '/images/email.png'
    assert_equal last_response.headers['Content-Length'], File.size(r("/app/images/email.png")).to_s
  end

  test "get img with cache buster" do
    get '/images/email.7a1b92c3f56ab5cfa73c1aa8222961cf.png'
    assert_equal last_response.headers['Content-Length'], File.size(r("/app/images/email.png")).to_s
  end

  test "compare" do
    i = Image['/app/images/email.png']
    j = Image['/app/images/email.png']

    assert j === i
  end

  test "dimensions" do
    i = Image['/app/images/email.png']
    j = Image['/app/images/email.png']

    Image.any_instance.expects(:`).times(1)
    j.dimensions
    i.dimensions
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sinatra-assetpack-0.3.5 test/img_test.rb
sinatra-assetpack-0.3.3 test/img_test.rb
sinatra-assetpack-0.3.2 test/img_test.rb
sinatra-assetpack-0.3.1 test/img_test.rb
sinatra-assetpack-0.3.0 test/img_test.rb
sinatra-assetpack-0.2.8 test/img_test.rb
sinatra-assetpack-0.2.7 test/img_test.rb
sinatra-assetpack-0.2.6 test/img_test.rb
sinatra-assetpack-0.2.5 test/img_test.rb
sinatra-assetpack-0.2.4 test/img_test.rb
sinatra-assetpack-0.2.3 test/img_test.rb
sinatra-assetpack-0.2.2 test/img_test.rb
sinatra-assetpack-0.2.1 test/img_test.rb
sinatra-assetpack-0.2.0 test/img_test.rb