/
sprockets_spec.rb
42 lines (32 loc) · 1.04 KB
/
sprockets_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require 'spec_helper'
describe 'Sprockets and Rails integration' do
it 'copies the asset paths into the Stylus load path' do
app = create_app
Stylus.paths.should =~ app.assets.paths
end
it 'process .styl files with the asset pipeline' do
result = fixture(:simple).last
app = create_app
app.assets['simple'].to_s.should == result
end
it 'enables @import definitions' do
result = fixture(:import).last
app = create_app
app.assets['import'].to_s.should == result
end
it 'skips debug info by default' do
app = create_app
asset = app.assets['simple']
asset.to_s.should_not match(/line 1 : #{asset.pathname}/)
end
it 'provides debug info if required' do
app = create_app(:debug => true)
asset = app.assets['simple']
asset.to_s.should match(/line 1 : #{asset.pathname}/)
end
it 'compress the output if Rails is configured to compress them too' do
result = fixture(:compressed).last
app = create_app(:compress => true)
app.assets['compressed'].to_s.should == result
end
end