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

configure_sast_iac_spec.rb « ci_configuration « security « mutations « graphql « api « requests « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c034f38dc80008898218ca708a73fef4b1d1d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'ConfigureSastIac' do
  include GraphqlHelpers

  let_it_be(:project) { create(:project, :test_repo) }

  let(:variables) { { project_path: project.full_path } }
  let(:mutation) { graphql_mutation(:configure_sast_iac, variables) }
  let(:mutation_response) { graphql_mutation_response(:configureSastIac) }

  context 'when authorized' do
    let_it_be(:user) { project.first_owner }

    it 'creates a branch with sast iac configured' do
      post_graphql_mutation(mutation, current_user: user)

      expect(response).to have_gitlab_http_status(:success)
      expect(mutation_response['errors']).to be_empty
      expect(mutation_response['branch']).not_to be_empty
      expect(mutation_response['successPath']).not_to be_empty
    end
  end
end