diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/assertions')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/response.rb | 9 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/selector.rb | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/response.rb b/actionpack/lib/action_dispatch/testing/assertions/response.rb index 5686bbdbde..c2486d3730 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/response.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/response.rb @@ -2,6 +2,15 @@ module ActionDispatch module Assertions # A small suite of assertions that test responses from Rails applications. module ResponseAssertions + extend ActiveSupport::Concern + + included do + # TODO: Need to pull in AV::Template monkey patches that track which + # templates are rendered. assert_template should probably be part + # of AV instead of AD. + require 'action_view/test_case' + end + # Asserts that the response is one of the following types: # # * <tt>:success</tt> - Status code was 200 diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index c2dc591ff7..a6b1126e2b 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -524,7 +524,7 @@ module ActionDispatch fix_content = lambda do |node| # Gets around a bug in the Rails 1.1 HTML parser. - node.content.gsub(/<!\[CDATA\[(.*)(\]\]>)?/m) { CGI.escapeHTML($1) } + node.content.gsub(/<!\[CDATA\[(.*)(\]\]>)?/m) { Rack::Utils.escapeHTML($1) } end selected = elements.map do |element| |