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
0e993a42
Commit
0e993a42
authored
Jul 06, 2021
by
Vasilii Iakliushin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update test to simplify default branch migration
Contributes to
https://gitlab.com/gitlab-org/gitlab/-/issues/331906
parent
2cf8a20b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
spec/features/projects/user_views_empty_project_spec.rb
spec/features/projects/user_views_empty_project_spec.rb
+6
-4
spec/requests/api/wikis_spec.rb
spec/requests/api/wikis_spec.rb
+2
-1
No files found.
spec/features/projects/user_views_empty_project_spec.rb
View file @
0e993a42
...
...
@@ -7,10 +7,12 @@ RSpec.describe 'User views an empty project' do
let_it_be
(
:user
)
{
create
(
:user
)
}
shared_examples
'allowing push to default branch'
do
it
'shows push-to-master instructions'
do
let
(
:default_branch
)
{
project
.
default_branch_or_main
}
it
'shows push-to-default-branch instructions'
do
visit
project_path
(
project
)
expect
(
page
).
to
have_content
(
'git push -u origin master'
)
expect
(
page
).
to
have_content
(
"git push -u origin
#{
default_branch
}
"
)
end
end
...
...
@@ -47,7 +49,7 @@ RSpec.describe 'User views an empty project' do
it
'does not show push-to-master instructions'
do
visit
project_path
(
project
)
expect
(
page
).
not_to
have_content
(
'git push -u origin
master
'
)
expect
(
page
).
not_to
have_content
(
'git push -u origin'
)
end
end
end
...
...
@@ -61,7 +63,7 @@ RSpec.describe 'User views an empty project' do
it
'does not show push-to-master instructions nor invite members link'
,
:aggregate_failures
,
:js
do
visit
project_path
(
project
)
expect
(
page
).
not_to
have_content
(
'git push -u origin
master
'
)
expect
(
page
).
not_to
have_content
(
'git push -u origin'
)
expect
(
page
).
not_to
have_button
(
text:
'Invite members'
)
end
end
...
...
spec/requests/api/wikis_spec.rb
View file @
0e993a42
...
...
@@ -611,11 +611,12 @@ RSpec.describe API::Wikis do
let
(
:payload
)
{
{
file:
fixture_file_upload
(
'spec/fixtures/dk.png'
)
}
}
let
(
:url
)
{
"/projects/
#{
project
.
id
}
/wikis/attachments"
}
let
(
:file_path
)
{
"
#{
Wikis
::
CreateAttachmentService
::
ATTACHMENT_PATH
}
/fixed_hex/dk.png"
}
let
(
:branch
)
{
wiki
.
default_branch
}
let
(
:result_hash
)
do
{
file_name:
'dk.png'
,
file_path:
file_path
,
branch:
'master'
,
branch:
branch
,
link:
{
url:
file_path
,
markdown:
"![dk](
#{
file_path
}
)"
...
...
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