Remove more warnings on AP.

This commit is contained in:
Emilio Tagua 2010-09-28 18:01:48 -03:00
parent ad2c21089e
commit 523f98099d
3 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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