From a45ee9e5e394f1663bf6d96424f42a3e2a21af80 Mon Sep 17 00:00:00 2001 From: Timm Date: Wed, 31 Jul 2013 16:14:00 +0200 Subject: add_regex returns inspected value for non Regexp objects. Workaround, so users don't have to care about enclosing values in double quotes. --- actionpack/lib/action_dispatch/testing/assertions/selector.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack') 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 -- cgit v1.2.3