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

create_project_snippet_spec.rb « snippet « 3_create « 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: 0f01a965e7bda8ff996452102ae5124f421d6202 (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
# frozen_string_literal: true

module QA
  RSpec.describe 'Create' do # to be converted to a smoke test once proved to be stable
    describe 'Project snippet creation' do
      let(:snippet) do
        Resource::ProjectSnippet.fabricate_via_browser_ui! do |snippet|
          snippet.title = 'Project snippet'
          snippet.description = ' '
          snippet.visibility = 'Private'
          snippet.file_name = 'markdown_file.md'
          snippet.file_content = "### Snippet heading\n\n[Example link](https://example.com/)"
        end
      end

      before do
        Flow::Login.sign_in
      end

      after do
        snippet.remove_via_api!
      end

      it 'user creates a project snippet', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347798' do
        snippet

        Page::Dashboard::Snippet::Show.perform do |snippet|
          expect(snippet).to have_snippet_title('Project snippet')
          expect(snippet).not_to have_snippet_description
          expect(snippet).to have_visibility_type(/private/i)
          expect(snippet).to have_file_name('markdown_file.md')
          expect(snippet).to have_file_content('Snippet heading')
          expect(snippet).to have_file_content('Example link')
          expect(snippet).not_to have_file_content('###')
          expect(snippet).not_to have_file_content('https://example.com/')
        end
      end
    end
  end
end