Sha256: 2bded919016386e8714f4c311a9901afe809e4a4401dee65792724beb2009b87

Contents?: true

Size: 828 Bytes

Versions: 17

Compression:

Stored size: 828 Bytes

Contents

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

class HelpersTest < UnitTest
  Main.get('/helper/foo') { img '/images/foo.jpg' }
  Main.get('/helper/email') { img '/images/email.png' }
  Main.get('/helper/css/all') { css :application, :sq }
  Main.get('/helper/css/app') { css :application }
  Main.get('/helper/css/sq') { css :sq }

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

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

  test "css" do
    re = Array.new
    get '/helper/css/app'; re << body
    get '/helper/css/sq';  re << body

    get '/helper/css/all'
    assert body.gsub(/[\r\n]*/m, '') == re.join('')
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
sinatra-assetpack-0.1.7 test/helpers_test.rb
sundawg-sinatra-assetpack-fork-0.1.6 test/helpers_test.rb
sinatra-assetpack-0.1.6 test/helpers_test.rb
sinatra-assetpack-0.1.5 test/helpers_test.rb
sinatra-assetpack-0.1.4 test/helpers_test.rb
sinatra-assetpack-0.1.3 test/helpers_test.rb
sinatra-assetpack-0.1.2 test/helpers_test.rb
sinatra-assetpack-0.1.1 test/helpers_test.rb
sinatra-assetpack-0.1.0 test/helpers_test.rb
sinatra-assetpack-flexible-compression-0.0.1 test/helpers_test.rb
sundawg-sinatra-assetpack-fork-0.0.12.pre1 test/helpers_test.rb
sinatra-assetpack-0.0.12.pre1 test/helpers_test.rb
sinatra-assetpack-0.0.11 test/helpers_test.rb
sinatra-assetpack-0.0.10 test/helpers_test.rb
sinatra-assetpack-0.0.9 test/helpers_test.rb
sinatra-assetpack-0.0.8 test/helpers_test.rb
sinatra-assetpack-0.0.6 test/helpers_test.rb