vendor/rails/actionpack/test/controller/session_management_test.rb in radiant-0.6.9 vs vendor/rails/actionpack/test/controller/session_management_test.rb in radiant-0.7.0
- old
+ new
@@ -1,6 +1,6 @@
-require File.dirname(__FILE__) + '/../abstract_unit'
+require 'abstract_unit'
class SessionManagementTest < Test::Unit::TestCase
class SessionOffController < ActionController::Base
session :off
@@ -11,10 +11,23 @@
def tell
render :text => "done"
end
end
+ class SessionOffOnController < ActionController::Base
+ session :off
+ session :on, :only => :tell
+
+ def show
+ render :text => "done"
+ end
+
+ def tell
+ render :text => "done"
+ end
+ end
+
class TestController < ActionController::Base
session :off, :only => :show
session :session_secure => true, :except => :show
session :off, :only => :conditional,
:if => Proc.new { |r| r.parameters[:ws] }
@@ -98,9 +111,18 @@
assert_equal false, @request.session_options
get :tell
assert_equal false, @request.session_options
end
+ def test_session_off_then_on_globally
+ @controller = SessionOffOnController.new
+ get :show
+ assert_equal false, @request.session_options
+ get :tell
+ assert_instance_of Hash, @request.session_options
+ assert_equal false, @request.session_options[:disabled]
+ end
+
def test_session_off_conditionally
@controller = TestController.new
get :show
assert_equal false, @request.session_options
get :tell