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

authorization_config_scopes_spec.rb « agents « clusters « concerns « models « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a4d1a33b3d52defbb7eac023f14100c83dc6ec5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Clusters::Agents::AuthorizationConfigScopes do
  describe '.with_available_ci_access_fields' do
    let(:project) { create(:project) }

    let!(:agent_authorization_0)     { create(:agent_project_authorization, project: project) }
    let!(:agent_authorization_1)     { create(:agent_project_authorization, project: project, config: { access_as: {} }) }
    let!(:agent_authorization_2)     { create(:agent_project_authorization, project: project, config: { access_as: { agent: {} } }) }
    let!(:impersonate_authorization) { create(:agent_project_authorization, project: project, config: { access_as: { impersonate: {} } }) }
    let!(:ci_user_authorization)     { create(:agent_project_authorization, project: project, config: { access_as: { ci_user: {} } }) }
    let!(:ci_job_authorization)      { create(:agent_project_authorization, project: project, config: { access_as: { ci_job: {} } }) }
    let!(:unexpected_authorization)  { create(:agent_project_authorization, project: project, config: { access_as: { unexpected: {} } }) }

    subject { Clusters::Agents::ProjectAuthorization.with_available_ci_access_fields(project) }

    it { is_expected.to contain_exactly(agent_authorization_0, agent_authorization_1, agent_authorization_2) }
  end
end