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
5e37b060
Commit
5e37b060
authored
Nov 05, 2021
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not allow maintainer to push to maintain 404
parent
fe8f24a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+10
-11
No files found.
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
5e37b060
...
...
@@ -10,7 +10,8 @@ RSpec.describe Projects::MergeRequestsController do
let_it_be_with_reload
(
:project_public_with_private_builds
)
{
create
(
:project
,
:repository
,
:public
,
:builds_private
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
merge_request_source_project
,
allow_maintainer_to_push:
false
)
}
let
(
:merge_request_source_project
)
{
project
}
before
do
sign_in
(
user
)
...
...
@@ -2073,8 +2074,6 @@ RSpec.describe Projects::MergeRequestsController do
end
describe
'POST #rebase'
do
let
(
:viewer
)
{
user
}
def
post_rebase
post
:rebase
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
merge_request
}
end
...
...
@@ -2085,7 +2084,7 @@ RSpec.describe Projects::MergeRequestsController do
context
'successfully'
do
it
'enqeues a RebaseWorker'
do
expect_rebase_worker_for
(
view
er
)
expect_rebase_worker_for
(
us
er
)
post_rebase
...
...
@@ -2108,17 +2107,17 @@ RSpec.describe Projects::MergeRequestsController do
context
'with a forked project'
do
let
(
:forked_project
)
{
fork_project
(
project
,
fork_owner
,
repository:
true
)
}
let
(
:fork_owner
)
{
create
(
:user
)
}
let
(
:merge_request_source_project
)
{
forked_project
}
before
do
project
.
add_developer
(
fork_owner
)
context
'user cannot push to source branch'
do
before
do
project
.
add_developer
(
fork_owner
)
merge_request
.
update!
(
source_project:
forked_project
)
forked_project
.
add_reporter
(
user
)
end
forked_project
.
add_reporter
(
user
)
end
context
'user cannot push to source branch'
do
it
'returns 404'
do
expect_rebase_worker_for
(
view
er
).
never
expect_rebase_worker_for
(
us
er
).
never
post_rebase
...
...
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