# encoding: utf-8 require 'spec_helper' require 'rack/classy_assets' class MiddlewareApp < Sinatra::Base set :root, File.expand_path('../../support', __FILE__) set :public_folder, File.join(settings.root, 'public') set :sprockets, Sprockets::Environment.new(settings.root) use Rack::ClassyAssets, root: settings.root, sprockets: settings.sprockets end describe Rack::ClassyAssets do include Rack::Test::Methods def app MiddlewareApp.new end describe "stylesheets" do describe "css" do it "will respond sucessfully" do get '/assets/stylesheet.css' last_response.status.must_equal 200 end end describe "sass" do it "will respond sucessfully" do get '/assets/application.css' last_response.status.must_equal 200 end end end describe "javascripts" do describe "js" do it "will respond sucessfully" do get '/assets/javascript.js' last_response.status.must_equal 200 end end describe "coffeescript" do it "will respond sucessfully" do get '/assets/application.js' last_response.status.must_equal 200 end end end describe "images" do describe "gif" do it "will respond sucessfully" do get '/assets/image.gif' last_response.status.must_equal 200 end end describe "jpg" do it "will respond sucessfully" do get '/assets/image.jpg' last_response.status.must_equal 200 end end describe "png" do it "will respond sucessfully" do get '/assets/image.png' last_response.status.must_equal 200 end end end end