Skip to content
This repository
Browse code

Ensure assert_select works with XML namespaced attributes [#1547 stat…

…e:resolved] [Jon Yurek]
  • Loading branch information...
commit 272c2d2e9ca38a307878306bff4315183d1ae7ab 1 parent 4185fb1
Pratik authored March 07, 2009
2  actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb
@@ -556,7 +556,7 @@ def simple_selector(statement, values, can_negate = true)
556 556
         end
557 557
 
558 558
         # Attribute value.
559  
-        next if statement.sub!(/^\[\s*([[:alpha:]][\w\-]*)\s*((?:[~|^$*])?=)?\s*('[^']*'|"[^*]"|[^\]]*)\s*\]/) do |match|
  559
+        next if statement.sub!(/^\[\s*([[:alpha:]][\w\-:]*)\s*((?:[~|^$*])?=)?\s*('[^']*'|"[^*]"|[^\]]*)\s*\]/) do |match|
560 560
           name, equality, value = $1, $2, $3
561 561
           if value == "?"
562 562
             value = values.shift
5  actionpack/test/controller/assert_select_test.rb
@@ -256,6 +256,11 @@ def test_assert_select_rjs_for_positioned_insert_should_fail_when_mixing_argumen
256 256
     assert_raises(Assertion) {assert_select_rjs :insert, :top, "test2"}
257 257
   end
258 258
 
  259
+  def test_elect_with_xml_namespace_attributes
  260
+    render_html %Q{<link xlink:href="http://nowhere.com"></link>}
  261
+    assert_nothing_raised { assert_select "link[xlink:href=http://nowhere.com]" }
  262
+  end
  263
+
259 264
   #
260 265
   # Test css_select.
261 266
   #

0 notes on commit 272c2d2

Please sign in to comment.
Something went wrong with that request. Please try again.