blob: 0a01afd97d866e160e8300be552f16ee05c9f068 (
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
44
45
46
47
|
# frozen_string_literal: true
module QA
RSpec.describe 'Create' do
describe 'File with unusual name' do
let(:file_name) { '-un:usually;named#file?.md' }
let(:project) do
Resource::Project.fabricate_via_api! do |resource|
resource.name = 'unusually-named-file-project'
resource.initialize_with_readme = true
end
end
before do
Flow::Login.sign_in
end
context 'when file name starts with a dash and contains hash, semicolon, colon, and question mark' do
it 'renders repository file tree correctly', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/quality/test_cases/1810' do
Resource::File.fabricate_via_api! do |file|
file.project = project
file.commit_message = 'Add new file'
file.name = "test-folder/#{file_name}"
file.content = "### Heading\n\n[Gitlab link](https://gitlab.com/)"
end
project.visit!
Page::Project::Show.perform do |show|
show.click_file('test-folder')
expect(show).to have_file(file_name)
show.click_file(file_name)
aggregate_failures 'markdown file contents' do
expect(show).to have_content('Heading')
expect(show).to have_content('Gitlab link')
expect(show).not_to have_content('###')
expect(show).not_to have_content('https://gitlab.com/')
end
end
end
end
end
end
end
|