diff options
Diffstat (limited to 'actionpack/lib/action_controller')
3 files changed, 7 insertions, 6 deletions
| diff --git a/actionpack/lib/action_controller/assertions.rb b/actionpack/lib/action_controller/assertions.rb index cb8d0e79ae..e04d4ccde0 100644 --- a/actionpack/lib/action_controller/assertions.rb +++ b/actionpack/lib/action_controller/assertions.rb @@ -191,8 +191,9 @@ module Test #:nodoc:        #   * <tt>:only</tt>: another hash consisting of the keys to use        #     to match on the children, and only matching children will be        #     counted. -      # * <tt>:content</tt>: (text nodes only). The content of the node must -      #   match the given value. +      # * <tt>:content</tt>: the textual content of the node must match the +      #     given value. This will not match HTML tags in the body of a +      #     tag--only text.        #        # Conditions are matched using the following algorithm:        # diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb index 8d1c711226..6d045b0367 100644 --- a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb +++ b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb @@ -379,9 +379,9 @@ module HTML #:nodoc:      #                               :child => /hello world/ }      def match(conditions)        conditions = validate_conditions(conditions) -   -      # only Text nodes have content -      return false if conditions[:content] + +      # check content of child nodes +      return false unless children.find { |child| child.match(conditions[:content]) } if conditions[:content]        # test the name        return false unless match_condition(@name, conditions[:tag]) if conditions[:tag] diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb index 0b4d184a8b..99a8d5766c 100644 --- a/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb +++ b/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb @@ -3,7 +3,7 @@ module HTML #:nodoc:      MAJOR = 0      MINOR = 5 -    TINY  = 1 +    TINY  = 2      STRING = [ MAJOR, MINOR, TINY ].join(".") | 
