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
3f5d6054
Commit
3f5d6054
authored
Nov 17, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve reverting_merge_request spec
parent
edba150d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+23
-4
No files found.
spec/models/merge_request_spec.rb
View file @
3f5d6054
...
...
@@ -2451,8 +2451,8 @@ RSpec.describe MergeRequest, factory_default: :keep do
context
'when there is a revert commit by MR'
do
let
(
:current_user
)
{
subject
.
author
}
let
(
:branch
)
{
subject
.
target
_branch
}
let
(
:project
)
{
subject
.
target
_project
}
let
(
:branch
)
{
subject
.
source
_branch
}
let
(
:project
)
{
subject
.
source
_project
}
let
(
:revert_commit_id
)
do
params
=
{
...
...
@@ -2464,10 +2464,29 @@ RSpec.describe MergeRequest, factory_default: :keep do
Commits
::
RevertService
.
new
(
project
,
current_user
,
params
).
execute
[
:result
]
end
let
(
:revert_merge_request
)
{
create
(
:merge_request
,
merge_commit_sha:
revert_commit_id
)
}
let
(
:revert_merge_request
)
do
create
(
:merge_request
,
author:
subject
.
author
,
target_project:
subject
.
target_project
,
source_project:
subject
.
source_project
,
merge_commit_sha:
revert_commit_id
,
description:
"This reverts merge request !
#{
subject
.
id
}
"
)
end
it
'returns nil'
do
expect
(
subject
.
reverting_merge_request
(
current_user
)).
to
be
(
revert_merge_request
)
ProcessCommitWorker
.
new
.
perform
(
project
.
id
,
current_user
.
id
,
project
.
commit
(
revert_commit_id
).
to_hash
,
project
.
default_branch
==
branch
)
MergeRequests
::
MergeService
.
new
(
subject
.
target_project
,
subject
.
author
,
{
sha:
revert_merge_request
.
diff_head_sha
}
).
execute
(
revert_merge_request
)
expect
(
subject
.
reverting_merge_request
(
current_user
)).
to
eq
(
revert_merge_request
)
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