Sha256: abe2641f648dc5cea2a585546dbef0cd10ac56782c372b8c752e4911d54c15bd

Contents?: true

Size: 815 Bytes

Versions: 4

Compression:

Stored size: 815 Bytes

Contents

require 'test_helper'

module SessionTest
  class PersistenceTest < ActiveSupport::TestCase
    def test_find
      aaron = users(:aaron)
      refute UserSession.find
      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

4 entries across 4 versions & 1 rubygems

Version Path
authlogic-3.8.0 test/session_test/persistence_test.rb
authlogic-3.7.0 test/session_test/persistence_test.rb
authlogic-3.6.1 test/session_test/persistence_test.rb
authlogic-3.6.0 test/session_test/persistence_test.rb