# encoding: utf-8 require 'spec_helper' require 'rack/classy_assets' class ClassyApp < Sinatra::Base use Rack::ClassyAssets end def app ClassyApp.new end describe Rack::ClassyAssets do before do ClassyAssets.config do |config| config.asset_root = File.expand_path('../../support', __FILE__) config.asset_debug = false config.asset_digest = false config.asset_host = nil end end context "stylesheets" do context "css" do it "will respond sucessfully" do get '/assets/stylesheet.css' last_response.status.must_equal 200 end end context "sass" do it "will respond sucessfully" do get '/assets/application.css' last_response.status.must_equal 200 end end end context "javascripts" do context "js" do it "will respond sucessfully" do get '/assets/javascript.js' last_response.status.must_equal 200 end end context "coffeescript" do it "will respond sucessfully" do get '/assets/application.js' last_response.status.must_equal 200 end end end context "images" do context "gif" do it "will respond sucessfully" do get '/assets/image.gif' last_response.status.must_equal 200 end end context "jpg" do it "will respond sucessfully" do get '/assets/image.jpg' last_response.status.must_equal 200 end end context "png" do it "will respond sucessfully" do get '/assets/image.png' last_response.status.must_equal 200 end end end context "fonts" do context "eot" do it "will respond sucessfully" do get '/assets/font.eot' last_response.status.must_equal 200 end end context "otf" do it "will respond sucessfully" do get '/assets/font.otf' last_response.status.must_equal 200 end end context "svg" do it "will respond sucessfully" do get '/assets/font.svg' last_response.status.must_equal 200 end end context "ttf" do it "will respond sucessfully" do get '/assets/font.ttf' last_response.status.must_equal 200 end end context "woff" do it "will respond sucessfully" do get '/assets/font.woff' last_response.status.must_equal 200 end end end end