1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/spec/minify_javascript_spec.rb
2009-11-13 12:25:16 -08:00

20 lines
No EOL
715 B
Ruby
Executable file

require File.join(File.dirname(__FILE__), "spec_helper")
base = ::Middleman::Base
base.set :root, File.join(File.dirname(__FILE__), "fixtures", "sample")
describe "Minify Javascript Feature" do
it "should not minify inline js if off" do
base.disable :minify_javascript
browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
browser.get("/inline-js.html")
browser.last_response.body.chomp.split($/).length.should == 10
end
it "should minify inline js if on" do
base.enable :minify_javascript
browser = Rack::Test::Session.new(Rack::MockSession.new(base.new))
browser.get("/inline-js.html")
browser.last_response.body.chomp.split($/).length.should == 1
end
end