Sha256: 6dc99dac457e5e5c16da122656568d48021eb24ee4a605350a13ac7224a68a03

Contents?: true

Size: 1.28 KB

Versions: 27

Compression:

Stored size: 1.28 KB

Contents

require 'test_helper'

module SessionTest
  module ActivationTest
    class ClassMethodsTest < ActiveSupport::TestCase
      def test_activated
        assert UserSession.activated?
        Authlogic::Session::Base.controller = nil
        assert !UserSession.activated?
      end
    
      def test_controller
        Authlogic::Session::Base.controller = nil
        assert_nil Authlogic::Session::Base.controller
        thread1 = Thread.new do
          controller = MockController.new
          Authlogic::Session::Base.controller = controller
          assert_equal controller, Authlogic::Session::Base.controller
        end
        thread1.join

        assert_nil Authlogic::Session::Base.controller
      
        thread2 = Thread.new do
          controller = MockController.new
          Authlogic::Session::Base.controller = controller
          assert_equal controller, Authlogic::Session::Base.controller
        end
        thread2.join
      
        assert_nil Authlogic::Session::Base.controller
      end
    end
    
    class InstanceMethodsTest < ActiveSupport::TestCase
      def test_init
        UserSession.controller = nil
        assert_raise(Authlogic::Session::Activation::NotActivatedError) { UserSession.new }
        UserSession.controller = controller
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 9 rubygems

Version Path
authlogic-3.4.6 test/session_test/activation_test.rb
authlogic-3.4.5 test/session_test/activation_test.rb
authlogic-3.4.4 test/session_test/activation_test.rb
authlogic-3.4.3 test/session_test/activation_test.rb
authlogic-3.4.2 test/session_test/activation_test.rb
authlogic-3.4.1 test/session_test/activation_test.rb
authlogic-3.4.0 test/session_test/activation_test.rb
authlogic-3.3.0 test/session_test/activation_test.rb
authlogic-3.2.0 test/session_test/activation_test.rb
authlogic-3.1.3 test/session_test/activation_test.rb
authlogic-3.1.2 test/session_test/activation_test.rb
authlogic-3.1.1 test/session_test/activation_test.rb
nulogy-authlogic-3.1.0.1 test/session_test/activation_test.rb
Empact-authlogic-3.1.0 test/session_test/activation_test.rb
authlogic-3.1.0 test/session_test/activation_test.rb
Empact-authlogic-3.0.3 test/session_test/activation_test.rb
antlypls-authlogic-3.0.3 test/session_test/activation_test.rb
authlogic-3.0.3 test/session_test/activation_test.rb
authlogic-3.0.2 test/session_test/activation_test.rb
authlogic-3.0.1 test/session_test/activation_test.rb