diff options
author | Timm <kaspth@gmail.com> | 2013-08-16 20:15:25 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-16 21:04:08 +0200 |
commit | ce4396b3663c2d2c108307e8c67dc35e8170ec6e (patch) | |
tree | 148576c274a24c379231b0455e8a5ccb1480a791 | |
parent | 20615ec7e6658be53e713545967f8c054303ec3c (diff) | |
download | rails-ce4396b3663c2d2c108307e8c67dc35e8170ec6e.tar.gz rails-ce4396b3663c2d2c108307e8c67dc35e8170ec6e.tar.bz2 rails-ce4396b3663c2d2c108307e8c67dc35e8170ec6e.zip |
Changed: put selector extraction into selector_from, which is renamed to extract_selector.
-rw-r--r-- | actionview/lib/action_view/testing/assertions/selector.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionview/lib/action_view/testing/assertions/selector.rb b/actionview/lib/action_view/testing/assertions/selector.rb index dda45b5730..60517c143b 100644 --- a/actionview/lib/action_view/testing/assertions/selector.rb +++ b/actionview/lib/action_view/testing/assertions/selector.rb @@ -314,8 +314,7 @@ module ActionView @root = determine_root_from(args.first, page, selected) # First or second argument is the selector - selector = @css_selector_is_second_argument ? args.shift(2).last : args.shift - @css_selector = selector_from(selector, args) + @css_selector = extract_selector(args) @equality_tests = equality_tests_from(args.shift) @message = args.shift @@ -377,11 +376,12 @@ module ActionView end end - def selector_from(selector, substitution_values) + def extract_selector(values) + selector = @css_selector_is_second_argument ? values.shift(2).last : values.shift unless selector.is_a? String raise ArgumentError, "Expecting a selector as the first argument" end - context.substitute!(selector, substitution_values) + context.substitute!(selector, values) end def equality_tests_from(comparator) |