1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove deprecated methods since 2-3-stable.

This commit is contained in:
José Valim 2010-05-18 02:11:50 +02:00
parent 0c3cde404a
commit 26e645fa00
2 changed files with 6 additions and 46 deletions

View file

@ -22,13 +22,6 @@ module ActionDispatch
@loaded = false
end
def session_id
ActiveSupport::Deprecation.warn(
"ActionDispatch::Session::AbstractStore::SessionHash#session_id " +
"has been deprecated. Please use request.session_options[:id] instead.", caller)
@env[ENV_SESSION_OPTIONS_KEY][:id]
end
def [](key)
load! unless @loaded
super(key.to_s)
@ -45,35 +38,14 @@ module ActionDispatch
h
end
def update(hash = nil)
if hash.nil?
ActiveSupport::Deprecation.warn('use replace instead', caller)
replace({})
else
load! unless @loaded
super(hash.stringify_keys)
end
def update(hash)
load! unless @loaded
super(hash.stringify_keys)
end
def delete(key = nil)
if key.nil?
ActiveSupport::Deprecation.warn('use clear instead', caller)
clear
else
load! unless @loaded
super(key.to_s)
end
end
def data
ActiveSupport::Deprecation.warn(
"ActionDispatch::Session::AbstractStore::SessionHash#data " +
"has been deprecated. Please use #to_hash instead.", caller)
to_hash
end
def close
ActiveSupport::Deprecation.warn('sessions should no longer be closed', caller)
def delete(key)
load! unless @loaded
super(key.to_s)
end
def inspect

View file

@ -2,18 +2,6 @@ require 'abstract_unit'
require 'stringio'
class ActionController::TestSessionTest < ActiveSupport::TestCase
def test_calling_delete_without_parameters_raises_deprecation_warning_and_calls_to_clear_test_session
assert_deprecated(/use clear instead/){ ActionController::TestSession.new.delete }
end
def test_calling_update_without_parameters_raises_deprecation_warning_and_calls_to_clear_test_session
assert_deprecated(/use replace instead/){ ActionController::TestSession.new.update }
end
def test_calling_close_raises_deprecation_warning
assert_deprecated(/sessions should no longer be closed/){ ActionController::TestSession.new.close }
end
def test_ctor_allows_setting
session = ActionController::TestSession.new({:one => 'one', :two => 'two'})
assert_equal('one', session[:one])