Skip to content

Commit f591c12

Browse files
author
Dan Kang
committed
write failing test for AssetUrlHelper helpers
1 parent 9f2ea5f commit f591c12

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/test_helper.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,14 @@ def test_asset_not_precompiled_error
406406
@view.asset_url("foo.js")
407407
end
408408

409+
assert_raises(Sprockets::Rails::Helper::AssetFilteredError) do
410+
@view.javascript_path("foo")
411+
end
412+
413+
assert_raises(Sprockets::Rails::Helper::AssetFilteredError) do
414+
@view.javascript_url("foo")
415+
end
416+
409417
assert_raises(Sprockets::Rails::Helper::AssetFilteredError) do
410418
@view.javascript_include_tag("foo.js")
411419
end
@@ -422,10 +430,20 @@ def test_asset_not_precompiled_error
422430

423431
@view.asset_path("foo.js")
424432
@view.asset_url("foo.js")
433+
@view.javascript_path("foo")
434+
@view.javascript_url("foo")
425435
@view.javascript_include_tag("foo.js")
426436
@view.javascript_include_tag("foo")
427437
@view.javascript_include_tag(:foo)
428438

439+
assert_raises(Sprockets::Rails::Helper::AssetFilteredError) do
440+
@view.stylesheet_path("foo")
441+
end
442+
443+
assert_raises(Sprockets::Rails::Helper::AssetFilteredError) do
444+
@view.stylesheet_url("foo")
445+
end
446+
429447
assert_raises(Sprockets::Rails::Helper::AssetFilteredError) do
430448
@view.stylesheet_link_tag("foo")
431449
end
@@ -436,15 +454,21 @@ def test_asset_not_precompiled_error
436454
@view.javascript_include_tag("foo")
437455
end
438456

457+
@view.stylesheet_path("foo")
458+
@view.stylesheet_url("foo")
439459
@view.stylesheet_link_tag("foo")
440460

441461
Sprockets::Rails::Helper.precompile = [ lambda {|logical_path| true } ]
442462

443463
@view.asset_path("foo.js")
444464
@view.asset_url("foo.js")
465+
@view.javascript_path("foo")
466+
@view.javascript_url("foo")
445467
@view.javascript_include_tag("foo.js")
446468
@view.javascript_include_tag("foo")
447469
@view.javascript_include_tag(:foo)
470+
@view.stylesheet_path("foo")
471+
@view.stylesheet_url("foo")
448472
@view.stylesheet_link_tag("foo")
449473
end
450474
end

0 commit comments

Comments
 (0)