Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/ai/service_access_token_spec.rb')
-rw-r--r--spec/models/ai/service_access_token_spec.rb21
1 files changed, 5 insertions, 16 deletions
diff --git a/spec/models/ai/service_access_token_spec.rb b/spec/models/ai/service_access_token_spec.rb
index d979db4b3d6..d491735e604 100644
--- a/spec/models/ai/service_access_token_spec.rb
+++ b/spec/models/ai/service_access_token_spec.rb
@@ -2,10 +2,10 @@
require 'spec_helper'
-RSpec.describe Ai::ServiceAccessToken, type: :model, feature_category: :application_performance do
+RSpec.describe Ai::ServiceAccessToken, type: :model, feature_category: :cloud_connector do
describe '.expired', :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) }
+ let_it_be(:expired_token) { create(:service_access_token, :expired) }
+ let_it_be(:active_token) { create(:service_access_token, :active) }
it 'selects all expired tokens' do
expect(described_class.expired).to match_array([expired_token])
@@ -13,24 +13,14 @@ RSpec.describe Ai::ServiceAccessToken, type: :model, feature_category: :applicat
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) }
+ let_it_be(:expired_token) { create(:service_access_token, :expired) }
+ let_it_be(:active_token) { create(:service_access_token, :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) }
- let(:category) { :code_suggestions }
-
- it 'only selects tokens from the selected category' do
- expect(described_class.for_category(category)).to match_array([code_suggestions_token])
- end
- end
-
describe '#token' do
let(:token_value) { 'Abc' }
@@ -47,7 +37,6 @@ RSpec.describe Ai::ServiceAccessToken, type: :model, feature_category: :applicat
describe 'validations' do
it { is_expected.to validate_presence_of(:token) }
- it { is_expected.to validate_presence_of(:category) }
it { is_expected.to validate_presence_of(:expires_at) }
end
end