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

gitaly_mtls_spec.rb « gitaly « 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: 5000c273578909bc521fec0470e2dac31de9fe01 (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
39
40
41
42
43
# frozen_string_literal: true

module QA
  RSpec.describe 'Create' do
    context 'Gitaly', :orchestrated, :mtls do
      describe 'Using mTLS' do
        let(:intial_commit_message) { 'Initial commit' }
        let(:first_added_commit_message) { 'commit over git' }
        let(:second_added_commit_message) { 'commit over api' }

        it 'pushes to gitaly', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347677' do
          project = Resource::Project.fabricate! do |project|
            project.name = "mTLS"
            project.initialize_with_readme = true
          end

          Resource::Repository::ProjectPush.fabricate! do |push|
            push.project = project
            push.new_branch = false
            push.commit_message = first_added_commit_message
            push.file_content = 'First commit'
          end

          Resource::Repository::Commit.fabricate_via_api! do |commit|
            commit.project = project
            commit.commit_message = second_added_commit_message
            commit.add_files([
              {
                file_path: "file-#{SecureRandom.hex(8)}",
                content: 'Second commit'
              }
            ])
          end

          expect(project.commits.map { |commit| commit[:message].chomp })
            .to include(intial_commit_message)
            .and include(first_added_commit_message)
            .and include(second_added_commit_message)
        end
      end
    end
  end
end