Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix: assert_template should not search for partial matches - regex mo…

…dified
  • Loading branch information...
commit c1814169b4fe22978ddac38813ce5c3cf24d2ef1 1 parent 9dee540
@sandeepr-sourcebits sandeepr-sourcebits authored
View
2  actionpack/lib/action_controller/test_case.rb
@@ -80,7 +80,7 @@ def assert_template(options = {}, message = nil)
options, rendered.keys.join(', '))
assert_block(msg) do
if options
- rendered.any? { |t,num| t.match(options) }
+ rendered.any? { |t,num| t.match(options + "$") }
else
@templates.blank?
end
View
7 actionpack/test/controller/action_pack_assertions_test.rb
@@ -478,6 +478,13 @@ def test_assert_template_reset_between_requests
get :nothing
assert_template nil
end
+
+ def test_fails_with_partially_matching_string
+ get :hello_world
+ assert_raise(ActiveSupport::TestCase::Assertion) do
+ assert_template 'hello'
+ end
+ end
end
class ActionPackHeaderTest < ActionController::TestCase
Please sign in to comment.
Something went wrong with that request. Please try again.