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
919c0c7b
Commit
919c0c7b
authored
Aug 16, 2017
by
Saverio Miroddi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extended UTs for the new cherry-pick message format
parent
ae5e806f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
spec/models/commit_spec.rb
spec/models/commit_spec.rb
+24
-0
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+4
-1
No files found.
spec/models/commit_spec.rb
View file @
919c0c7b
...
...
@@ -195,6 +195,30 @@ eos
it
{
expect
(
data
[
:removed
]).
to
eq
([])
}
end
describe
'#cherry_pick_message'
do
let
(
:regular_commit
)
{
project
.
commit
(
'video'
)
}
let
(
:merge_commit
)
{
project
.
commit
(
'wip'
)
}
context
'of a regular commit'
do
it
{
expect
(
regular_commit
.
cherry_pick_message
(
project
,
'master'
)).
to
include
(
"
\n\n
(cherry picked from commit 88790590ed1337ab189bccaa355f068481c90bec)"
)
}
end
context
'of a merge commit'
do
it
do
expected_appended_text
=
<<~
STR
.
rstrip
(cherry picked from commit b9238ee5bf1d7359dd3b8c89fd76c1c7f8b75aba)
6d664995 This commit will be fixupped against
64117577 fixup! This commit will be fixupped against
STR
expect
(
merge_commit
.
cherry_pick_message
(
project
,
'master'
)).
to
include
(
expected_appended_text
)
end
end
end
describe
'#reverts_commit?'
do
let
(
:another_commit
)
{
double
(
:commit
,
revert_description:
"This reverts commit
#{
commit
.
sha
}
"
)
}
let
(
:user
)
{
commit
.
author
}
...
...
spec/models/repository_spec.rb
View file @
919c0c7b
...
...
@@ -1344,8 +1344,11 @@ describe Repository, models: true do
it
'cherry-picks the changes'
do
expect
(
repository
.
blob_at_branch
(
'improve/awesome'
,
'foo/bar/.gitkeep'
)).
to
be_nil
repository
.
cherry_pick
(
user
,
pickable_merge
,
'improve/awesome'
)
cherry_pick_commit_sha
=
repository
.
cherry_pick
(
user
,
pickable_merge
,
'improve/awesome'
)
cherry_pick_commit_message
=
project
.
commit
(
cherry_pick_commit_sha
).
message
expect
(
repository
.
blob_at_branch
(
'improve/awesome'
,
'foo/bar/.gitkeep'
)).
not_to
be_nil
expect
(
cherry_pick_commit_message
).
to
include
(
'cherry picked from'
)
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