Sha256: eac616631ce64bd836e8e36815e3262bc1579c14549cf810e1543cb121abe0fa
Contents?: true
Size: 706 Bytes
Versions: 16
Compression:
Stored size: 706 Bytes
Contents
require 'test_helper' module Workarea class User class AuthenticationTokenTestCase < TestCase setup :set_user def set_user @user = create_user end def test_authenticate assert(AuthenticationToken.authenticate('asflkjasdflkjas').blank?) auth = AuthenticationToken.create!(user: @user) assert_equal(auth, AuthenticationToken.authenticate(auth.token)) end def test_expired auth = AuthenticationToken.create!(user: @user) refute(auth.expired?) expired = (Workarea.config.authentication_token_expiration + 1.day).from_now travel_to expired assert(auth.expired?) end end end end
Version data entries
16 entries across 16 versions & 2 rubygems