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

custom_issue_template_spec.rb « issue « 2_plan « browser_ui « features « specs « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5ad590f40112055440ac939c5ab541bc7ae837d7 (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 'Plan' do
    describe 'Custom issue templates' do
      let(:template_name) { 'custom_issue_template'}
      let(:template_content) { 'This is a custom issue template test' }

      let(:template_project) do
        Resource::Project.fabricate_via_api! do |project|
          project.name = "custom-issue-template-project"
          project.initialize_with_readme = true
        end
      end

      before do
        Flow::Login.sign_in

        Resource::Repository::Commit.fabricate_via_api! do |commit|
          commit.project = template_project
          commit.commit_message = 'Add custom issue template'
          commit.add_files([
            {
              file_path: ".gitlab/issue_templates/#{template_name}.md",
              content: template_content
            }
          ])
        end
      end

      it 'creates an issue via custom template', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1612' do
        Resource::Issue.fabricate_via_browser_ui! do |issue|
          issue.project = template_project
          issue.template = template_name
        end

        Page::Project::Issue::Show.perform do |issue_page|
          expect(issue_page).to have_content(template_content)
        end
      end
    end
  end
end