diff options
author | José Valim <jose.valim@gmail.com> | 2010-09-29 10:04:42 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-29 10:04:42 +0200 |
commit | 0bbf9029e8089356aed0e3be2f859d56951a89cf (patch) | |
tree | 38e41ef8b63140a91c828bec03e06e83f38899b6 /actionpack/lib/action_dispatch/testing | |
parent | 006cef7107b648882cfc09f56904c601454cfc77 (diff) | |
parent | 17599abc9c06f30ff23d7ad47a3f029e32c26c88 (diff) | |
download | rails-0bbf9029e8089356aed0e3be2f859d56951a89cf.tar.gz rails-0bbf9029e8089356aed0e3be2f859d56951a89cf.tar.bz2 rails-0bbf9029e8089356aed0e3be2f859d56951a89cf.zip |
Merge remote branch 'miloops/warnings'
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/selector.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/integration.rb | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index 353be10d20..2b862fb7d6 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -67,7 +67,7 @@ module ActionDispatch arg = args.shift elsif arg == 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 @selected + elsif defined?(@selected) && @selected matches = [] @selected.each do |selected| @@ -187,6 +187,7 @@ module ActionDispatch def assert_select(*args, &block) # Start with optional element followed by mandatory selector. arg = args.shift + @selected ||= nil if arg.is_a?(HTML::Node) # First argument is a node (tag or text, but also HTML root), @@ -442,6 +443,7 @@ module ActionDispatch assert_block("") { true } # to count the assertion if block_given? && !([:remove, :show, :hide, :toggle].include? rjs_type) begin + @selected ||= nil in_scope, @selected = @selected, matches yield matches ensure diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index 3204115e9f..8c05462d0d 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -308,7 +308,7 @@ module ActionDispatch include ActionDispatch::Assertions def app - @app + @app ||= nil end # Reset the current session. This is useful for testing multiple sessions |