aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing/assertions
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-07-31 16:14:00 +0200
committerTimm <kaspth@gmail.com>2014-06-16 21:03:58 +0200
commita45ee9e5e394f1663bf6d96424f42a3e2a21af80 (patch)
tree1cd1fcabae984b16d2ac0e3c21ab81259b036507 /actionpack/lib/action_dispatch/testing/assertions
parent3ac4c6262274cc0b9000973fea5f99a4545ab545 (diff)
downloadrails-a45ee9e5e394f1663bf6d96424f42a3e2a21af80.tar.gz
rails-a45ee9e5e394f1663bf6d96424f42a3e2a21af80.tar.bz2
rails-a45ee9e5e394f1663bf6d96424f42a3e2a21af80.zip
add_regex returns inspected value for non Regexp objects. Workaround, so users don't have to care about enclosing values in double quotes.
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/assertions')
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/selector.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
index b6b47a6771..504eccd0a7 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb
@@ -428,7 +428,8 @@ module ActionDispatch
end
def add_regex(regex)
- return regex unless regex.is_a?(Regexp)
+ # Nokogiri doesn't like arbitrary values without quotes, hence inspect.
+ return regex.inspect unless regex.is_a?(Regexp)
@regexes.push(regex)
last_id.to_s # avoid implicit conversions of Fixnum to String
end