diff options
author | Timm <kaspth@gmail.com> | 2013-07-20 14:09:21 +0200 |
---|---|---|
committer | Timm <kaspth@gmail.com> | 2014-06-15 23:40:57 +0200 |
commit | afa4caf2bdd35e959674152d89b49968129e9fc9 (patch) | |
tree | e23c48891eeea7cf1320685419cfec13e3c264e7 /actionpack/lib/action_dispatch | |
parent | 205bfe9af80ad6bfee323f72e421587e6ad7e26f (diff) | |
download | rails-afa4caf2bdd35e959674152d89b49968129e9fc9.tar.gz rails-afa4caf2bdd35e959674152d89b49968129e9fc9.tar.bz2 rails-afa4caf2bdd35e959674152d89b49968129e9fc9.zip |
Updated selector to not have reponse_from_page.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/selector.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index 883073ad3e..586a6bd1ff 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -61,7 +61,7 @@ module ActionDispatch def css_select(*args) raise ArgumentError, "you at least need a selector" if args.empty? - if args.first.is_a?(String) # allow nokogiri's ability to use several selectors + if args.first.is_a?(String) # allow nokogiri's ability to use more selectors root, selectors = response_from_page, args else root, selectors = args.shift, args @@ -160,8 +160,8 @@ module ActionDispatch def assert_select(*args, &block) @selected ||= nil - parser = HTMLSelector.new(@selected, args, Proc.new do - Loofah.fragment('').tap { |fragment| fragment.add_child @selected } + parser = HTMLSelector.new(@selected, reponse_from_page, args, Proc.new do + Loofah.fragment('').tap { |f| f.add_child @selected } end) # Start with optional element followed by mandatory selector. @@ -353,9 +353,10 @@ module ActionDispatch class Selector #:nodoc: attr_accessor :root, :css_selector - def initialize(selected, *args, &root_for_nested_call_proc) + def initialize(selected, page, *args, &root_for_nested_call_proc) raise ArgumentError, "ArgumentsParser expects a block for parsing a nested call's arguments" unless block_given? @nested_call = selected + @page = page @args = args @@ -381,7 +382,7 @@ module ActionDispatch # root_or_selector is a selector since the first call failed root_for_nested_select_proc.call(root_or_selector) else - response_from_page + @page end end |