diff options
Diffstat (limited to 'spec/models/ai/service_access_token_spec.rb')
-rw-r--r-- | spec/models/ai/service_access_token_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/ai/service_access_token_spec.rb b/spec/models/ai/service_access_token_spec.rb index 12ed24f3bd6..d979db4b3d6 100644 --- a/spec/models/ai/service_access_token_spec.rb +++ b/spec/models/ai/service_access_token_spec.rb @@ -12,6 +12,15 @@ RSpec.describe Ai::ServiceAccessToken, type: :model, feature_category: :applicat end end + describe '.active', :freeze_time do + let_it_be(:expired_token) { create(:service_access_token, :code_suggestions, :expired) } + let_it_be(:active_token) { create(:service_access_token, :code_suggestions, :active) } + + it 'selects all active tokens' do + expect(described_class.active).to match_array([active_token]) + end + end + # There is currently only one category, please expand this test when a new category is added. describe '.for_category' do let(:code_suggestions_token) { create(:service_access_token, :code_suggestions) } |