diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-14 15:08:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-14 15:08:53 +0300 |
commit | 8a5138ed7d38ccff8b5ca2fe0f7bbb77f8fdaad3 (patch) | |
tree | 4c0d373c990fc01cacff9b4093366ab398fcb7d3 /spec/models/clusters | |
parent | 6d8f30ab0ae82678f10450d2158f24772f0c765c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/clusters')
-rw-r--r-- | spec/models/clusters/agents/authorizations/user_access/group_authorization_spec.rb | 16 | ||||
-rw-r--r-- | spec/models/clusters/agents/authorizations/user_access/project_authorization_spec.rb | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/spec/models/clusters/agents/authorizations/user_access/group_authorization_spec.rb b/spec/models/clusters/agents/authorizations/user_access/group_authorization_spec.rb new file mode 100644 index 00000000000..d7b4ea2388f --- /dev/null +++ b/spec/models/clusters/agents/authorizations/user_access/group_authorization_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Clusters::Agents::Authorizations::UserAccess::GroupAuthorization, feature_category: :kubernetes_management do + it { is_expected.to belong_to(:agent).class_name('Clusters::Agent').required } + it { is_expected.to belong_to(:group).class_name('::Group').required } + + it { expect(described_class).to validate_jsonb_schema(['config']) } + + describe '#config_project' do + let(:record) { create(:agent_user_access_group_authorization) } + + it { expect(record.config_project).to eq(record.agent.project) } + end +end diff --git a/spec/models/clusters/agents/authorizations/user_access/project_authorization_spec.rb b/spec/models/clusters/agents/authorizations/user_access/project_authorization_spec.rb new file mode 100644 index 00000000000..a51be15a9d7 --- /dev/null +++ b/spec/models/clusters/agents/authorizations/user_access/project_authorization_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Clusters::Agents::Authorizations::UserAccess::ProjectAuthorization, feature_category: :kubernetes_management do + it { is_expected.to belong_to(:agent).class_name('Clusters::Agent').required } + it { is_expected.to belong_to(:project).class_name('Project').required } + + it { expect(described_class).to validate_jsonb_schema(['config']) } + + describe '#config_project' do + let(:record) { create(:agent_user_access_project_authorization) } + + it { expect(record.config_project).to eq(record.agent.project) } + end +end |