Sha256: 09065ab8fd3d26f9b0e8190079e9ecbdcb39b9fdec17e8a91ae79c9df253ffe3

Contents?: true

Size: 832 Bytes

Versions: 16

Compression:

Stored size: 832 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper.rb'

module SessionTests
  class CookiesTest < ActiveSupport::TestCase
    def test_valid_cookie
      ben = users(:ben)
      session = UserSession.new
    
      assert !session.valid_cookie?
    
      set_cookie_for(ben)
      assert session.valid_cookie?
      assert_equal ben, session.unauthorized_record
    end
    
    def test_save
      ben = users(:ben)
      session = UserSession.new(ben)
      assert session.save
      assert_equal ben.persistence_token, @controller.cookies["user_credentials"]
    end
    
    def test_destroy
      ben = users(:ben)
      set_cookie_for(ben)
      session = UserSession.find
      assert @controller.cookies["user_credentials"]
      assert session.destroy
      assert !@controller.cookies["user_credentials"]
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
authlogic-1.3.0 test/session_tests/cookies_test.rb
authlogic-1.3.1 test/session_tests/cookies_test.rb
authlogic-1.3.2 test/session_tests/cookies_test.rb
authlogic-1.2.2 test/session_tests/cookies_test.rb
authlogic-1.2.1 test/session_tests/cookies_test.rb
authlogic-1.3.9 test/session_tests/cookies_test.rb
authlogic-1.4.1 test/session_tests/cookies_test.rb
authlogic-1.3.4 test/session_tests/cookies_test.rb
authlogic-1.3.5 test/session_tests/cookies_test.rb
authlogic-1.3.6 test/session_tests/cookies_test.rb
authlogic-1.3.7 test/session_tests/cookies_test.rb
authlogic-1.3.8 test/session_tests/cookies_test.rb
authlogic-1.4.0 test/session_tests/cookies_test.rb
authlogic-1.3.3 test/session_tests/cookies_test.rb
authlogic-1.4.3 test/session_tests/cookies_test.rb
authlogic-1.4.2 test/session_tests/cookies_test.rb