Sha256: 32278d5cfc803d7673a6650a93d3ccddc967998176b21f191f11c56f75293bee

Contents?: true

Size: 862 Bytes

Versions: 2

Compression:

Stored size: 862 Bytes

Contents

require 'test_helper'

module SessionTest
  class PersistenceTest < ActiveSupport::TestCase
    def test_find
      aaron = users(:aaron)
      refute UserSession.find
      UserSession.allow_http_basic_auth = true
      http_basic_auth_for(aaron) { assert UserSession.find }
      set_cookie_for(aaron)
      assert UserSession.find
      unset_cookie
      set_session_for(aaron)
      session = UserSession.find
      assert session
    end

    def test_persisting
      # tested thoroughly in test_find
    end

    def test_should_set_remember_me_on_the_next_request
      aaron = users(:aaron)
      session = UserSession.new(aaron)
      session.remember_me = true
      refute UserSession.remember_me
      assert session.save
      assert session.remember_me?
      session = UserSession.find(aaron)
      assert session.remember_me?
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authlogic-4.0.1 test/session_test/persistence_test.rb
authlogic-4.0.0 test/session_test/persistence_test.rb