diff options
author | Timm <kaspth@gmail.com> | 2013-08-16 20:23:55 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-16 21:04:08 +0200 |
commit | 65ed2b6371817e9110c2eecab080f952ea0e9667 (patch) | |
tree | 90f62157dbb60fc27bacaec4b9cd5496039b46b0 | |
parent | 9a536bc1958ae900b4c7c1f7c6f6e1bcd8622b18 (diff) | |
download | rails-65ed2b6371817e9110c2eecab080f952ea0e9667.tar.gz rails-65ed2b6371817e9110c2eecab080f952ea0e9667.tar.bz2 rails-65ed2b6371817e9110c2eecab080f952ea0e9667.zip |
Renamed: HTMLSelector css_selector to selector.
-rw-r--r-- | actionview/lib/action_view/testing/assertions/selector.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/actionview/lib/action_view/testing/assertions/selector.rb b/actionview/lib/action_view/testing/assertions/selector.rb index 3d65746701..d7266d4e99 100644 --- a/actionview/lib/action_view/testing/assertions/selector.rb +++ b/actionview/lib/action_view/testing/assertions/selector.rb @@ -305,14 +305,14 @@ module ActionView end class HTMLSelector #:nodoc: - attr_accessor :root, :css_selector, :equality_tests, :message + attr_accessor :root, :selector, :equality_tests, :message - alias :source :css_selector + alias :source :selector def initialize(selected, page, args) # Start with possible optional element followed by mandatory selector. @root = determine_root_from(args.first, page, selected) - @css_selector = extract_selector(args) + @selector = extract_selector(args) @equality_tests = equality_tests_from(args.shift) @message = args.shift @@ -323,7 +323,7 @@ module ActionView end def select - filter root.css(css_selector, context) + filter root.css(selector, context) end def filter(matches) @@ -354,13 +354,13 @@ module ActionView end def determine_root_from(root_or_selector, page, previous_selection = nil) - @css_selector_is_second_argument = false + @selector_is_second_argument = false if root_or_selector == nil raise ArgumentError, "First argument is either selector or element to select, but nil found. Perhaps you called assert_select with an element that does not exist?" elsif root_or_selector.is_a?(Nokogiri::XML::Node) || root_or_selector.is_a?(Nokogiri::XML::NodeSet) # First argument is a node (tag or text, but also HTML root), # so we know what we're selecting from. - @css_selector_is_second_argument = true + @selector_is_second_argument = true root_or_selector elsif previous_selection @@ -375,7 +375,7 @@ module ActionView end def extract_selector(values) - selector = @css_selector_is_second_argument ? values.shift(2).last : values.shift + selector = @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 |