Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 1661

Show
Ignore:
Timestamp:
07/04/05 15:05:40 (3 years ago)
Author:
minam
Message:

Updated html-scanner so that assert_tag(:tag => "p", :content => "foo") behaves as expected

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r1648 r1661  
    116116* Support :render option for :verify #1440 [TobiasLuetke] 
    117117 
    118 * Updated vendor copy of html-scanner lib to 0.5.1, for bug fixes and optimizations 
     118* Updated vendor copy of html-scanner lib to 0.5.2, for bug fixes and optimizations. The :content option may be used as expected--to find a tag whose textual content is a particular value--in assert_tag, now. 
    119119 
    120120* Changed test requests to come from 0.0.0.0 instead of 127.0.0.1 such that they don't trigger debugging screens on exceptions, but instead call rescue_action_in_public 
  • trunk/actionpack/lib/action_controller/assertions.rb

    r1659 r1661  
    192192      #     to match on the children, and only matching children will be 
    193193      #     counted. 
    194       # * <tt>:content</tt>: (text nodes only). The content of the node must 
    195       #   match the given value. 
     194      # * <tt>:content</tt>: the textual content of the node must match the 
     195      #     given value. This will not match HTML tags in the body of a 
     196      #     tag--only text. 
    196197      # 
    197198      # Conditions are matched using the following algorithm: 
  • trunk/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb

    r1416 r1661  
    380380    def match(conditions) 
    381381      conditions = validate_conditions(conditions) 
    382    
    383       # only Text nodes have content 
    384       return false if conditions[:content] 
     382 
     383      # check content of child nodes 
     384      return false unless children.find { |child| child.match(conditions[:content]) } if conditions[:content] 
    385385 
    386386      # test the name 
  • trunk/actionpack/lib/action_controller/vendor/html-scanner/html/version.rb

    r1416 r1661  
    44    MAJOR = 0 
    55    MINOR = 5 
    6     TINY  = 1 
     6    TINY  = 2 
    77 
    88    STRING = [ MAJOR, MINOR, TINY ].join(".")