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
8516e3ab
Commit
8516e3ab
authored
Sep 18, 2017
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add spec for forked project
parent
4714cb58
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
66 deletions
+70
-66
spec/ee/spec/controllers/projects/merge_requests_controller_spec.rb
...ec/controllers/projects/merge_requests_controller_spec.rb
+70
-66
No files found.
spec/ee/spec/controllers/projects/merge_requests_controller_spec.rb
View file @
8516e3ab
require
'spec_helper'
require
'spec_helper'
describe
Projects
::
MergeRequestsController
do
shared_examples
'approvals'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:viewer
)
{
user
}
before
do
sign_in
(
viewer
)
end
context
'approvals'
do
def
json_response
def
json_response
JSON
.
parse
(
response
.
body
)
JSON
.
parse
(
response
.
body
)
end
end
...
@@ -85,8 +75,20 @@ describe Projects::MergeRequestsController do
...
@@ -85,8 +75,20 @@ describe Projects::MergeRequestsController do
expect
(
json_response
[
'suggested_approvers'
].
size
).
to
eq
2
expect
(
json_response
[
'suggested_approvers'
].
size
).
to
eq
2
end
end
end
end
end
describe
Projects
::
MergeRequestsController
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
)
}
let
(
:user
)
{
project
.
owner
}
let
(
:viewer
)
{
user
}
before
do
sign_in
(
viewer
)
end
end
it_behaves_like
'approvals'
describe
'PUT update'
do
describe
'PUT update'
do
def
update_merge_request
(
params
=
{})
def
update_merge_request
(
params
=
{})
post
:update
,
post
:update
,
...
@@ -353,6 +355,8 @@ describe Projects::MergeRequestsController do
...
@@ -353,6 +355,8 @@ describe Projects::MergeRequestsController do
fork_project
.
add_reporter
(
user
)
fork_project
.
add_reporter
(
user
)
end
end
it_behaves_like
'approvals'
context
'user cannot push to source branch'
do
context
'user cannot push to source branch'
do
it
'returns 404'
do
it
'returns 404'
do
expect_rebase_worker_for
(
viewer
).
never
expect_rebase_worker_for
(
viewer
).
never
...
...
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