diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-09-28 18:01:48 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-09-28 18:01:48 -0300 |
commit | 523f98099d331908db6ab4c45f7657e61a8a4d5f (patch) | |
tree | 73c55e2d365e4b231c65855e189a11f387ca8234 | |
parent | ad2c21089e435527641d891a30ff8f695114071b (diff) | |
download | rails-523f98099d331908db6ab4c45f7657e61a8a4d5f.tar.gz rails-523f98099d331908db6ab4c45f7657e61a8a4d5f.tar.bz2 rails-523f98099d331908db6ab4c45f7657e61a8a4d5f.zip |
Remove more warnings on AP.
3 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb index 348a2d1eb2..ea49b30630 100644 --- a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb @@ -102,8 +102,8 @@ module ActionDispatch def destroy clear - @by.send(:destroy, @env) if @by - @env[ENV_SESSION_OPTIONS_KEY][:id] = nil if @env && @env[ENV_SESSION_OPTIONS_KEY] + @by.send(:destroy, @env) if defined?(@by) && @by + @env[ENV_SESSION_OPTIONS_KEY][:id] = nil if defined?(@env) && @env && @env[ENV_SESSION_OPTIONS_KEY] @loaded = false end diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index f5ecb9a199..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| @@ -443,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/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb index cf4a461622..d13ebc705a 100644 --- a/actionpack/test/controller/filters_test.rb +++ b/actionpack/test/controller/filters_test.rb @@ -669,7 +669,7 @@ class FilterTest < ActionController::TestCase assert_equal %w( ensure_login find_user ), assigns["ran_filter"] test_process(ConditionalSkippingController, "login") - assert_nil @controller.instance_variable_get("@ran_after_filter") + assert !@controller.instance_variable_defined?("@ran_after_filter") test_process(ConditionalSkippingController, "change_password") assert_equal %w( clean_up ), @controller.instance_variable_get("@ran_after_filter") end |