aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-03-07 16:13:34 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-07 16:13:34 +0000
commit272c2d2e9ca38a307878306bff4315183d1ae7ab (patch)
tree734bfbb799a8f7791dffe72889fcb386a69ac9d0 /actionpack
parent4185fb1e58d8142162c3a39f9302559688dd431b (diff)
downloadrails-272c2d2e9ca38a307878306bff4315183d1ae7ab.tar.gz
rails-272c2d2e9ca38a307878306bff4315183d1ae7ab.tar.bz2
rails-272c2d2e9ca38a307878306bff4315183d1ae7ab.zip
Ensure assert_select works with XML namespaced attributes [#1547 state:resolved] [Jon Yurek]
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb2
-rw-r--r--actionpack/test/controller/assert_select_test.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb
index 376bb87409..e2c49c284f 100644
--- a/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb
+++ b/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb
@@ -556,7 +556,7 @@ module HTML
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
diff --git a/actionpack/test/controller/assert_select_test.rb b/actionpack/test/controller/assert_select_test.rb
index 99c57c0c91..c543118530 100644
--- a/actionpack/test/controller/assert_select_test.rb
+++ b/actionpack/test/controller/assert_select_test.rb
@@ -256,6 +256,11 @@ class AssertSelectTest < ActionController::TestCase
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.
#