Skip to content

Commit 1e7559a

Browse files
committedMar 24, 2015
Add a spec to ensure complex sprockets files work
1 parent 009a4b1 commit 1e7559a

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
 

Diff for: ‎spec/lib/fixtures/complex_sprockets.js.rb.erb.str

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#= require no_requires
2+
//= require jst_file
3+
#= require_tree ./required_tree_test
4+
require 'file_with_directives'

Diff for: ‎spec/lib/fixtures/jst_file.js.jst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#= require sprockets_file

Diff for: ‎spec/lib/sprockets/server_spec.rb

+11
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ def app
2121
expect(last_response).to be_ok
2222
end
2323

24+
it 'serves assets with complex sprockets requires' do
25+
assets = app.sprockets['complex_sprockets'].to_a.map(&:logical_path)
26+
%w[
27+
no_requires.js
28+
jst_file.js
29+
required_tree_test/required_file1.js
30+
required_tree_test/required_file2.js
31+
file_with_directives.js
32+
].each { |logical_path| expect(assets).to include(logical_path) }
33+
end
34+
2435
describe 'source maps' do
2536
it 'serves map on a top level file' do
2637
get '/assets/source_map.js'

0 commit comments

Comments
 (0)
Please sign in to comment.