aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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