test sprockets with custom js_dir

This commit is contained in:
Thomas Reynolds 2011-08-09 11:12:20 -07:00
parent 6a3a480d13
commit da4ead8cf2
5 changed files with 15 additions and 0 deletions

View file

@ -4,3 +4,8 @@ Feature: Sprockets
Given the Server is running at "test-app" Given the Server is running at "test-app"
When I go to "/javascripts/sprockets_base.js" When I go to "/javascripts/sprockets_base.js"
Then I should see "sprockets_sub_function" Then I should see "sprockets_sub_function"
Scenario: Sprockets require with custom :js_dir
Given the Server is running at "sprockets-app"
When I go to "/library/javascripts/sprockets_base.js"
Then I should see "sprockets_sub_function"

View file

@ -0,0 +1 @@
set :js_dir, "library/javascripts"

View file

@ -0,0 +1,5 @@
//= require "sprockets_sub"
function base() {
}

View file

@ -0,0 +1,3 @@
function sprockets_sub_function() {
}

View file

@ -10,6 +10,7 @@ module Middleman::CoreExtensions::Sprockets
run JavascriptEnvironment.new(app) run JavascriptEnvironment.new(app)
end end
end end
# app.map "/#{app.css_dir}" do # app.map "/#{app.css_dir}" do
# run StylesheetEnvironment.new(app) # run StylesheetEnvironment.new(app)
# end # end