Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8e5ada04
Commit
8e5ada04
authored
Jul 15, 2020
by
Rémy Coutable
Committed by
Ramya Authappan
Jul 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure end-to-end tests use unique filenames in template tests
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
f509b553
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb
.../browser_ui/3_create/repository/add_file_template_spec.rb
+8
-4
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_file_template_spec.rb
.../ee/browser_ui/1_manage/group/group_file_template_spec.rb
+11
-9
No files found.
qa/qa/specs/features/browser_ui/3_create/repository/add_file_template_spec.rb
View file @
8e5ada04
# frozen_string_literal: true
require
'securerandom'
module
QA
RSpec
.
describe
'Create'
do
describe
'File templates'
do
...
...
@@ -54,12 +56,14 @@ module QA
expect
(
form
).
to
have_normalized_ws_text
(
content
[
0
..
100
])
form
.
add_name
(
"
#{
SecureRandom
.
hex
(
8
)
}
/
#{
template
[
:file_name
]
}
"
)
form
.
commit_changes
expect
(
form
).
to
have_content
(
'The file has been successfully created.'
)
expect
(
form
).
to
have_content
(
template
[
:file_name
])
expect
(
form
).
to
have_content
(
'Add new file'
)
expect
(
form
).
to
have_normalized_ws_text
(
content
[
0
..
100
])
aggregate_failures
"indications of file created"
do
expect
(
form
).
to
have_content
(
template
[
:file_name
])
expect
(
form
).
to
have_normalized_ws_text
(
content
[
0
..
100
])
expect
(
form
).
to
have_content
(
'Add new file'
)
end
end
end
end
...
...
qa/qa/specs/features/ee/browser_ui/1_manage/group/group_file_template_spec.rb
View file @
8e5ada04
# frozen_string_literal: true
require
'securerandom'
module
QA
RSpec
.
describe
'Manage'
do
describe
'Group file templates'
,
:requires_admin
do
...
...
@@ -7,19 +9,19 @@ module QA
templates
=
[
{
typ
e:
'Dockerfile'
,
file_nam
e:
'Dockerfile'
,
template:
'custom_dockerfile'
,
file_path:
'Dockerfile/custom_dockerfile.dockerfile'
,
content:
'dockerfile template test'
},
{
typ
e:
'.gitignore'
,
file_nam
e:
'.gitignore'
,
template:
'custom_gitignore'
,
file_path:
'gitignore/custom_gitignore.gitignore'
,
content:
'gitignore template test'
},
{
typ
e:
'.gitlab-ci.yml'
,
file_nam
e:
'.gitlab-ci.yml'
,
template:
'custom_gitlab-ci'
,
file_path:
'gitlab-ci/custom_gitlab-ci.yml'
,
content:
...
...
@@ -31,7 +33,7 @@ module QA
CI
},
{
typ
e:
'LICENSE'
,
file_nam
e:
'LICENSE'
,
template:
'custom_license'
,
file_path:
'LICENSE/custom_license.txt'
,
content:
'license template test'
...
...
@@ -92,7 +94,7 @@ module QA
end
templates
.
each
do
|
template
|
it
"creates file via custom
#{
template
[
:
typ
e
]
}
file template"
do
it
"creates file via custom
#{
template
[
:
file_nam
e
]
}
file template"
do
Flow
::
Login
.
sign_in_as_admin
set_file_template_if_not_already_set
...
...
@@ -101,18 +103,18 @@ module QA
Page
::
Project
::
Show
.
perform
(
&
:create_new_file!
)
Page
::
File
::
Form
.
perform
do
|
form
|
form
.
select_template
template
[
:
typ
e
],
template
[
:template
]
form
.
select_template
template
[
:
file_nam
e
],
template
[
:template
]
expect
(
form
).
to
have_normalized_ws_text
(
template
[
:content
])
form
.
add_name
(
"
#{
SecureRandom
.
hex
(
8
)
}
/
#{
template
[
:file_name
]
}
"
)
form
.
commit_changes
form
.
finished_loading?
aggregate_failures
"indications of file created"
do
expect
(
form
).
to
have_content
(
'The file has been successfully created.'
)
expect
(
form
).
to
have_content
(
template
[
:type
])
expect
(
form
).
to
have_content
(
'Add new file'
)
expect
(
form
).
to
have_content
(
template
[
:file_name
])
expect
(
form
).
to
have_normalized_ws_text
(
template
[
:content
].
chomp
)
expect
(
form
).
to
have_content
(
'Add new file'
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment