Skip to content

Commit

Permalink
Failing test for rails#6114
Browse files Browse the repository at this point in the history
  • Loading branch information
drogus committed Dec 16, 2010
1 parent 14b880f commit 7d2c0a9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions actionpack/test/template/asset_tag_helper_test.rb
Expand Up @@ -273,6 +273,14 @@ def test_custom_javascript_expansions_with_undefined_symbol
assert_raise(ArgumentError) { javascript_include_tag('first', :monkey, 'last') }
end

def test_custom_javascript_and_stylesheet_expansion
ENV["RAILS_ASSET_ID"] = ""
ActionView::Helpers::AssetTagHelper::register_javascript_expansion :robbery => ["bank", "robber"]
ActionView::Helpers::AssetTagHelper::register_stylesheet_expansion :robbery => ["money", "security"]
assert_dom_equal %(<script src="/javascripts/controls.js" type="text/javascript"></script>\n<script src="/javascripts/bank.js" type="text/javascript"></script>\n<script src="/javascripts/robber.js" type="text/javascript"></script>\n<script src="/javascripts/effects.js" type="text/javascript"></script>), javascript_include_tag('controls', :robbery, 'effects')
assert_dom_equal %(<link href="/stylesheets/style.css" rel="stylesheet" type="text/css" media="screen" />\n<link href="/stylesheets/money.css" rel="stylesheet" type="text/css" media="screen" />\n<link href="/stylesheets/security.css" rel="stylesheet" type="text/css" media="screen" />\n<link href="/stylesheets/print.css" rel="stylesheet" type="text/css" media="screen" />), stylesheet_link_tag('style', :robbery, 'print')
end

def test_reset_javascript_expansions
JavascriptIncludeTag.expansions.clear
assert_raise(ArgumentError) { javascript_include_tag(:defaults) }
Expand Down

0 comments on commit 7d2c0a9

Please sign in to comment.