Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…e:resolved] [Jon Yurek]
commit 272c2d2e9ca38a307878306bff4315183d1ae7ab 1 parent 4185fb1
@lifo lifo authored
View
2  actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb
@@ -556,7 +556,7 @@ def simple_selector(statement, values, can_negate = true)
end
# Attribute value.
- next if statement.sub!(/^\[\s*([[:alpha:]][\w\-]*)\s*((?:[~|^$*])?=)?\s*('[^']*'|"[^*]"|[^\]]*)\s*\]/) do |match|
+ next if statement.sub!(/^\[\s*([[:alpha:]][\w\-:]*)\s*((?:[~|^$*])?=)?\s*('[^']*'|"[^*]"|[^\]]*)\s*\]/) do |match|
name, equality, value = $1, $2, $3
if value == "?"
value = values.shift
View
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
assert_raises(Assertion) {assert_select_rjs :insert, :top, "test2"}
end
+ def test_elect_with_xml_namespace_attributes
+ render_html %Q{<link xlink:href="http://nowhere.com"></link>}
+ assert_nothing_raised { assert_select "link[xlink:href=http://nowhere.com]" }
+ end
+
#
# Test css_select.
#
Please sign in to comment.
Something went wrong with that request. Please try again.