aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/assertions/selector_assertions.rb
diff options
context:
space:
mode:
authorrick <rick@spacemonkey.local>2008-05-05 23:19:21 -0700
committerrick <rick@spacemonkey.local>2008-05-05 23:19:21 -0700
commit0052938ac5b8894b27fdb9f27b1ed39f0a9ea176 (patch)
treef714643a4043d9fb73b39ec2a114d18f5deeffdd /actionpack/lib/action_controller/assertions/selector_assertions.rb
parenteacb5cf0cab6447db78085c8bda6c94dd329ce6b (diff)
parent3cffe92ff066c2b35eef409547db93652c5cccfc (diff)
downloadrails-0052938ac5b8894b27fdb9f27b1ed39f0a9ea176.tar.gz
rails-0052938ac5b8894b27fdb9f27b1ed39f0a9ea176.tar.bz2
rails-0052938ac5b8894b27fdb9f27b1ed39f0a9ea176.zip
Merge commit 'core/master'
Diffstat (limited to 'actionpack/lib/action_controller/assertions/selector_assertions.rb')
-rw-r--r--actionpack/lib/action_controller/assertions/selector_assertions.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/assertions/selector_assertions.rb b/actionpack/lib/action_controller/assertions/selector_assertions.rb
index 573405c0f9..272b8f6841 100644
--- a/actionpack/lib/action_controller/assertions/selector_assertions.rb
+++ b/actionpack/lib/action_controller/assertions/selector_assertions.rb
@@ -263,12 +263,15 @@ module ActionController
if match_with = equals[:text]
matches.delete_if do |match|
text = ""
+ text.force_encoding(match_with.encoding) if text.respond_to?(:force_encoding)
stack = match.children.reverse
while node = stack.pop
if node.tag?
stack.concat node.children.reverse
else
- text << node.content
+ content = node.content
+ content.force_encoding(match_with.encoding) if content.respond_to?(:force_encoding)
+ text << content
end
end
text.strip! unless NO_STRIP.include?(match.name)