Sha256: 02fb2e09db75906fce49652bb3926c2b47eaea0b2f441ee02751880ba58425a4

Contents?: true

Size: 698 Bytes

Versions: 13

Compression:

Stored size: 698 Bytes

Contents

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

class CacheDynamicAssetTest < UnitTest
  class App < Main
    set :reload_templates, true
  end

  def app
    App
  end

  test "served from cache" do
    app.assets.cache_dynamic_assets = true
    Sinatra::AssetPack::Css.stubs(:preproc).times(1)
    get '/css/screen.css'
    get '/css/screen.css'
    get '/css/screen.css'
    assert last_response.status == 200
  end

  test "not served from cache when disable" do
    app.assets.cache_dynamic_assets = false
    Sinatra::AssetPack::Css.stubs(:preproc).times(3)
    get '/css/screen.css'
    get '/css/screen.css'
    get '/css/screen.css'
    assert last_response.status == 200
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

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