aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-05-07 20:16:42 +0200
committerGitHub <noreply@github.com>2017-05-07 20:16:42 +0200
commit45095a817b29f3b4956abce5d059410d591b902a (patch)
tree5bf7fc2271ddc5d4ed511db35893c2049142831b /actionview/test/template
parentaf58740b8d943f90a18c3e7ceca9432775cfe192 (diff)
parentb201474756a2ee493406ad0cb49f49c6873bdc28 (diff)
downloadrails-45095a817b29f3b4956abce5d059410d591b902a.tar.gz
rails-45095a817b29f3b4956abce5d059410d591b902a.tar.bz2
rails-45095a817b29f3b4956abce5d059410d591b902a.zip
Merge pull request #29005 from kamipo/should_escape_meta_chars_in_regexp
Should escape meta characters in regexp
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/asset_tag_helper_test.rb6
-rw-r--r--actionview/test/template/atom_feed_helper_test.rb8
-rw-r--r--actionview/test/template/render_test.rb4
3 files changed, 9 insertions, 9 deletions
diff --git a/actionview/test/template/asset_tag_helper_test.rb b/actionview/test/template/asset_tag_helper_test.rb
index 07a6452cc1..b7a993c5c9 100644
--- a/actionview/test/template/asset_tag_helper_test.rb
+++ b/actionview/test/template/asset_tag_helper_test.rb
@@ -709,13 +709,13 @@ class AssetTagHelperNonVhostTest < ActionView::TestCase
def test_should_wildcard_asset_host
@controller.config.asset_host = "http://a%d.example.com"
- assert_match(%r(http://a[0123].example.com), compute_asset_host("foo"))
+ assert_match(%r(http://a[0123]\.example\.com), compute_asset_host("foo"))
end
def test_should_wildcard_asset_host_between_zero_and_four
@controller.config.asset_host = "http://a%d.example.com"
- assert_match(%r(http://a[0123].example.com/collaboration/hieraki/images/xml.png), image_path("xml.png"))
- assert_match(%r(http://a[0123].example.com/collaboration/hieraki/images/xml.png), image_url("xml.png"))
+ assert_match(%r(http://a[0123]\.example\.com/collaboration/hieraki/images/xml\.png), image_path("xml.png"))
+ assert_match(%r(http://a[0123]\.example\.com/collaboration/hieraki/images/xml\.png), image_url("xml.png"))
end
def test_asset_host_without_protocol_should_be_protocol_relative
diff --git a/actionview/test/template/atom_feed_helper_test.rb b/actionview/test/template/atom_feed_helper_test.rb
index 1245a1a966..7304b769a4 100644
--- a/actionview/test/template/atom_feed_helper_test.rb
+++ b/actionview/test/template/atom_feed_helper_test.rb
@@ -301,8 +301,8 @@ class AtomFeedTest < ActionController::TestCase
with_restful_routing(:scrolls) do
get :index, params: { id: "feed_with_atomPub_namespace" }
assert_match %r{xml:lang="en-US"}, @response.body
- assert_match %r{xmlns="http://www.w3.org/2005/Atom"}, @response.body
- assert_match %r{xmlns:app="http://www.w3.org/2007/app"}, @response.body
+ assert_match %r{xmlns="http://www\.w3\.org/2005/Atom"}, @response.body
+ assert_match %r{xmlns:app="http://www\.w3\.org/2007/app"}, @response.body
end
end
@@ -319,7 +319,7 @@ class AtomFeedTest < ActionController::TestCase
with_restful_routing(:scrolls) do
get :index, params: { id: "feed_with_xml_processing_instructions" }
assert_match %r{<\?xml-stylesheet [^\?]*type="text/css"}, @response.body
- assert_match %r{<\?xml-stylesheet [^\?]*href="t.css"}, @response.body
+ assert_match %r{<\?xml-stylesheet [^\?]*href="t\.css"}, @response.body
end
end
@@ -334,7 +334,7 @@ class AtomFeedTest < ActionController::TestCase
def test_feed_xhtml
with_restful_routing(:scrolls) do
get :index, params: { id: "feed_with_xhtml_content" }
- assert_match %r{xmlns="http://www.w3.org/1999/xhtml"}, @response.body
+ assert_match %r{xmlns="http://www\.w3\.org/1999/xhtml"}, @response.body
assert_select "summary", text: /Something Boring/
assert_select "summary", text: /after 2/
end
diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb
index 9f9882afee..3f66ab3ed3 100644
--- a/actionview/test/template/render_test.rb
+++ b/actionview/test/template/render_test.rb
@@ -27,7 +27,7 @@ module RenderTestCases
def test_render_without_options
e = assert_raises(ArgumentError) { @view.render() }
- assert_match(/You invoked render but did not give any of (.+) option./, e.message)
+ assert_match(/You invoked render but did not give any of (.+) option\./, e.message)
end
def test_render_file
@@ -261,7 +261,7 @@ module RenderTestCases
def test_render_sub_template_with_errors
e = assert_raises(ActionView::Template::Error) { @view.render(template: "test/sub_template_raise") }
assert_match %r!method.*doesnt_exist!, e.message
- assert_match %r{Trace of template inclusion: .*test/sub_template_raise.html.erb}, e.sub_template_message
+ assert_match %r{Trace of template inclusion: .*test/sub_template_raise\.html\.erb}, e.sub_template_message
assert_equal "1", e.line_number
assert_equal File.expand_path("#{FIXTURE_LOAD_PATH}/test/_raise.html.erb"), e.file_name
end