blob: aeb8e7d27bfa1fbddcd3c4f0508f6b204906a419 (
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', :smoke, product_group: :editor do
describe 'Personal snippet creation' do
let(:snippet) do
Resource::Snippet.fabricate_via_browser_ui! do |snippet|
snippet.title = 'Snippet title'
snippet.description = 'Snippet description'
snippet.visibility = 'Private'
snippet.file_name = 'ruby_file.rb'
snippet.file_content = 'File.read("test.txt").split(/\n/)'
end
end
before do
Flow::Login.sign_in
end
after do
if Runtime::Env.personal_access_tokens_disabled?
snippet.visit!
Page::Dashboard::Snippet::Show.perform(&:click_delete_button)
else
snippet.remove_via_api!
end
end
it 'user creates a personal snippet', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347799' do
snippet
Page::Dashboard::Snippet::Show.perform do |snippet|
expect(snippet).to have_snippet_title('Snippet title')
expect(snippet).to have_snippet_description('Snippet description')
expect(snippet).to have_visibility_type(/private/i)
expect(snippet).to have_file_name('ruby_file.rb')
expect(snippet).to have_file_content('File.read("test.txt").split(/\n/)')
expect(snippet).to have_syntax_highlighting('ruby')
end
end
end
end
end
|