Sha256: c118ec6376ed4535cedc7fabe1219f62834850bbcf6734c19fea3eb666277e93
Contents?: true
Size: 1.81 KB
Versions: 1
Compression:
Stored size: 1.81 KB
Contents
require File.dirname(__FILE__) + '/../test/test_helper' # Test that helpers from ActionView::Helpers::AssetTagHelper are properly # escaped. class AssetTagHelper < ActionView::TestCase def test_auto_discovery_link_tag assert_render( %(<%= auto_discovery_link_tag "foo&bar" %>) => %( <link href="/test/foobar" title="FOO&BAR" rel="alternate" type="\ foo&bar"#{XHTML_TAGS}>)) end def test_image_path assert_render( %(<%= image_path "foo&bar" %>) => %(/images/foo&bar)) end def test_image_tag assert_render( %(<%= image_tag "foo&bar" %>) => %( <img src="/images/foo&bar" alt="Foo&bar"#{XHTML_TAGS}>)) end def test_javascript_include_tag assert_render( %(<%= javascript_include_tag "foo&bar" %>) => %( <script type="text/javascript" src="/javascripts/foo&bar.js"></script>)) end def test_javascript_path assert_render( %(<%= javascript_path "foo&bar" %>) => %(/javascripts/foo&bar.js)) end # Alias for image_path. def test_path_to_image assert_render( %(<%= path_to_image "foo&bar" %>) => %(/images/foo&bar)) end # Alias for javascript_path. def test_path_to_javascript assert_render( %(<%= path_to_javascript "foo&bar" %>) => %(/javascripts/foo&bar.js)) end # Alias for stylesheet_path. def test_path_to_stylesheet assert_render( %(<%= path_to_stylesheet "foo&bar" %>) => %(/stylesheets/foo&bar.css)) end def test_stylesheet_link_tag assert_render( %(<%= stylesheet_link_tag "foo&bar" %>) => %( <link href="/stylesheets/foo&bar.css" rel="stylesheet" type=\ "text/css" media="screen"#{XHTML_TAGS}>)) end def test_stylesheet_path assert_render( %(<%= stylesheet_path "foo&bar" %>) => %(/stylesheets/foo&bar.css)) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
xss_shield-2.0.0 | test/asset_tag_helper_test.rb |