spec/plugin/assets_spec.rb in roda-3.25.0 vs spec/plugin/assets_spec.rb in roda-3.26.0

- old
+ new

@@ -331,9 +331,24 @@ try_compressor.call(:none, :uglifier) try_compressor.call(:none, :minjs) end it 'should handle compiling assets, linking to them, and accepting requests for them' do + app.plugin :assets, :js=>{:head => %w'comment_1.js comment_2.js'} + app.compile_assets + html = body('/test') + html.scan(/<script/).length.must_equal 1 + html =~ %r{src="(/assets/app\.head\.[a-f0-9]{64}\.js)"} + js = body($1) + js.must_equal <<END +// test +/* +a = 1; +*/ +END + end + + it 'should separate compiled assets with new lines' do app.compile_assets html = body('/test') html.scan(/<link/).length.must_equal 1 html =~ %r{href="(/assets/app\.[a-f0-9]{64}\.css)"} css = body($1)