main
 1# frozen_string_literal: true
 2
 3FactoryBot.define do
 4  factory :token do
 5    authorization { nil }
 6    association :audience, factory: :client
 7    association :subject, factory: :user
 8
 9    factory :access_token do
10      token_type { :access }
11    end
12
13    factory :refresh_token do
14      token_type { :refresh }
15    end
16
17    trait :revoked do
18      revoked_at { Time.current }
19    end
20
21    trait :expired do
22      expired_at { 1.minute.ago }
23    end
24  end
25end