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
4b348452
Commit
4b348452
authored
Jun 10, 2021
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for updating default branch in projects API
parent
3621b7dc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+13
-1
No files found.
spec/requests/api/projects_spec.rb
View file @
4b348452
...
...
@@ -53,7 +53,7 @@ RSpec.describe API::Projects do
let_it_be
(
:user2
)
{
create
(
:user
)
}
let_it_be
(
:user3
)
{
create
(
:user
)
}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
:repository
,
namespace:
user
.
namespace
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
:repository
,
create_branch:
'something_else'
,
namespace:
user
.
namespace
)
}
let_it_be
(
:project2
,
reload:
true
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let_it_be
(
:project_member
)
{
create
(
:project_member
,
:developer
,
user:
user3
,
project:
project
)
}
let_it_be
(
:user4
)
{
create
(
:user
,
username:
'user.with.dot'
)
}
...
...
@@ -2895,6 +2895,18 @@ RSpec.describe API::Projects do
end
end
it
'updates default_branch'
do
project_param
=
{
default_branch:
'something_else'
}
put
api
(
"/projects/
#{
project
.
id
}
"
,
user
),
params:
project_param
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
project_param
.
each_pair
do
|
k
,
v
|
expect
(
json_response
[
k
.
to_s
]).
to
eq
(
v
)
end
end
it
'updates jobs_enabled'
do
project_param
=
{
jobs_enabled:
true
}
...
...
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