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

commit_to_templated_project_spec.rb « repository « 3_create « api « features « specs « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c06912e0367b92a3ad8e5a93c57e323474b313f0 (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
27
28
29
30
31
32
33
34
35
36
37
38
# frozen_string_literal: true

module QA
  RSpec.describe 'Create' do
    describe 'Create a new project from a template' do
      let(:project) do
        Resource::Project.fabricate_via_api! do |project|
          project.name = 'templated-project'
          project.template_name = 'dotnetcore'
        end
      end

      it 'commits via the api', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/357234' do
        expect do
          Resource::Repository::Commit.fabricate_via_api! do |commit|
            commit.project = project
            commit.update_files(
              [
                  {
                      file_path: '.gitlab-ci.yml',
                      content: 'script'
                  }
              ]
            )
            commit.add_files(
              [
                  {
                      file_path: 'foo',
                      content: 'bar'
                  }
              ]
            )
          end
        end.not_to raise_exception
      end
    end
  end
end