Sha256: 0eae34f9c1730e0c6385bb26adb4dc8cacc72479be07aebea37b73373bb2fb75

Contents?: true

Size: 425 Bytes

Versions: 2

Compression:

Stored size: 425 Bytes

Contents

require 'test_helper'

class UserTest < ActiveSupport::TestCase
  test 'ensures an api key' do
    user = User.create
    assert_not_nil user.api_key
  end

  test 'renew an api key' do
    user = User.create
    Timecop.freeze(4.hours.since) do
      old_key = user.api_key.access_token
      user.renew_api_key
      assert_not_equal old_key, user.api_key.access_token
      assert !user.api_key.expired?
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_token_auth-0.0.4 test/simple_token_auth/user_test.rb
simple_token_auth-0.0.3 test/simple_token_auth/user_test.rb