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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
e6220c01
Commit
e6220c01
authored
Aug 21, 2017
by
Saverio Miroddi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add UT for cherry-pick of an existing merge that is not found
parent
83417865
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
19 deletions
+30
-19
spec/models/commit_spec.rb
spec/models/commit_spec.rb
+30
-19
No files found.
spec/models/commit_spec.rb
View file @
e6220c01
...
@@ -212,25 +212,27 @@ eos
...
@@ -212,25 +212,27 @@ eos
{
message:
'Test message'
,
committer:
author
,
author:
author
}
{
message:
'Test message'
,
committer:
author
,
author:
author
}
end
end
let
(
:merge_
commi
t
)
do
let
(
:merge_
reques
t
)
do
merge_request
=
create
(
:merge_request
,
create
(
:merge_request
,
source_branch:
'video'
,
source_branch:
'video'
,
target_branch:
'master'
,
target_branch:
'master'
,
source_project:
project
,
source_project:
project
,
author:
user
)
author:
user
)
end
let
(
:merge_commit
)
do
merge_commit_id
=
repository
.
merge
(
user
,
merge_commit_id
=
repository
.
merge
(
user
,
merge_request
.
diff_head_sha
,
merge_request
.
diff_head_sha
,
merge_request
,
merge_request
,
commit_options
)
commit_options
)
merge_commit
=
repository
.
commit
(
merge_commit_id
)
repository
.
commit
(
merge_commit_id
)
end
# Manually mark as completed.
#
merge_request
.
update
(
merge_commit_sha:
merge_commit_id
)
merge_commit
context
'that is found'
do
before
do
# Artificially mark as completed.
merge_request
.
update
(
merge_commit_sha:
merge_commit
.
id
)
end
end
it
do
it
do
...
@@ -245,6 +247,15 @@ eos
...
@@ -245,6 +247,15 @@ eos
expect
(
merge_commit
.
cherry_pick_message
(
user
)).
to
include
(
expected_appended_text
)
expect
(
merge_commit
.
cherry_pick_message
(
user
)).
to
include
(
expected_appended_text
)
end
end
end
end
context
"that is existing but not found (eg. it's in progress)"
do
it
do
expect
(
merge_commit
.
cherry_pick_message
(
user
)).
to
end_with
(
"(cherry picked from commit
#{
merge_commit
.
sha
}
)"
)
end
end
end
end
end
describe
'#reverts_commit?'
do
describe
'#reverts_commit?'
do
...
...
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