Sha256: 620b115e883b57d90bb8abcc577cda4768b7662b5ec6d1bd8f9726c30a172016

Contents?: true

Size: 882 Bytes

Versions: 9

Compression:

Stored size: 882 Bytes

Contents

require 'test_helper'

module SessionTest
  class HttpAuthTest < ActiveSupport::TestCase
    class ConfiTest < ActiveSupport::TestCase
      def test_allow_http_basic_auth
        UserSession.allow_http_basic_auth = false
        assert_equal false, UserSession.allow_http_basic_auth
    
        UserSession.allow_http_basic_auth true
        assert_equal true, UserSession.allow_http_basic_auth
      end
    end
    
    class InstanceMethodsTest < ActiveSupport::TestCase
      def test_persist_persist_by_http_auth
        ben = users(:ben)
        http_basic_auth_for { assert !UserSession.find }
        http_basic_auth_for(ben) do
          assert session = UserSession.find
          assert_equal ben, session.record
          assert_equal ben.login, session.login
          assert_equal "benrocks", session.send(:protected_password)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 6 rubygems

Version Path
authlogic-3.0.2 test/session_test/http_auth_test.rb
authlogic-3.0.1 test/session_test/http_auth_test.rb
authlogic-3.0.0 test/session_test/http_auth_test.rb
authlogic-rails3-2.2 test/session_test/http_auth_test.rb
kb-authlogic-2.1.7 test/session_test/http_auth_test.rb
railsware-authlogic-2.1.6.1 test/session_test/http_auth_test.rb
cotweet-authlogic-2.1.6 test/session_test/http_auth_test.rb
jdl-authlogic-2.1.6.2 test/session_test/http_auth_test.rb
jdl-authlogic-2.1.6.1 test/session_test/http_auth_test.rb