aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/asset_tag_helper_test.rb
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2018-04-19 08:24:21 +0100
committerGitHub <noreply@github.com>2018-04-19 08:24:21 +0100
commitfb2af6f849c8d25732f2c17352c59f2dc8b8320d (patch)
tree9ea30543b6b2f68f15d9c0b711054ee035a4b8fe /actionview/test/template/asset_tag_helper_test.rb
parent7d25b651fa9011b040fab2f19fb315679519edb2 (diff)
parentef2af628a9ec1cc4e7b6997a021dd3f85cfe4665 (diff)
downloadrails-fb2af6f849c8d25732f2c17352c59f2dc8b8320d.tar.gz
rails-fb2af6f849c8d25732f2c17352c59f2dc8b8320d.tar.bz2
rails-fb2af6f849c8d25732f2c17352c59f2dc8b8320d.zip
Merge branch 'master' into fix-as-timezone-all
Diffstat (limited to 'actionview/test/template/asset_tag_helper_test.rb')
-rw-r--r--actionview/test/template/asset_tag_helper_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionview/test/template/asset_tag_helper_test.rb b/actionview/test/template/asset_tag_helper_test.rb
index 6d98eacfb8..e68f03d1f4 100644
--- a/actionview/test/template/asset_tag_helper_test.rb
+++ b/actionview/test/template/asset_tag_helper_test.rb
@@ -29,6 +29,10 @@ class AssetTagHelperTest < ActionView::TestCase
"http://www.example.com"
end
+ def content_security_policy_nonce
+ "iyhD0Yc0W+c="
+ end
+
AssetPathToTag = {
%(asset_path("")) => %(),
%(asset_path(" ")) => %(),
@@ -421,6 +425,10 @@ class AssetTagHelperTest < ActionView::TestCase
assert_dom_equal %(<script src="//assets.example.com/javascripts/prototype.js"></script>), javascript_include_tag("prototype")
end
+ def test_javascript_include_tag_nonce
+ assert_dom_equal %(<script src="/javascripts/bank.js" nonce="iyhD0Yc0W+c="></script>), javascript_include_tag("bank", nonce: true)
+ end
+
def test_stylesheet_path
StylePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
end