提交 272c2d2e 编写于 作者: P Pratik Naik

Ensure assert_select works with XML namespaced attributes [#1547 state:resolved] [Jon Yurek]

上级 4185fb1e
......@@ -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
......
......@@ -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.
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册