Sha256: 423d42aae2d2f076160aa4e547765b92182ee9825cf00b879d5ef41df5405891

Contents?: true

Size: 488 Bytes

Versions: 1

Compression:

Stored size: 488 Bytes

Contents

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

class HelpersTest < UnitTest
  Main.get '/img/foo' do
    img '/images/foo.jpg'
  end

  Main.get '/img/email' do
    img '/images/email.png'
  end

  test "img non-existing" do
    get '/img/foo'
    assert body == "<img src='/images/foo.jpg' />"
  end

  test "img existing" do
    get '/img/email'
    assert body =~ %r{src='/images/email.[0-9]+.png'}
    assert body =~ %r{width='16'}
    assert body =~ %r{height='16'}
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sinatra-assetpack-0.0.5 test/helpers_test.rb