Add UT for cherry-pick of an existing merge that is not found
This commit is contained in:
parent
83417865d0
commit
e6220c018e
|
@ -212,25 +212,27 @@ eos
|
||||||
{ message: 'Test message', committer: author, author: author }
|
{ message: 'Test message', committer: author, author: author }
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:merge_commit) do
|
let(:merge_request) 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.
|
context 'that is found' do
|
||||||
#
|
before do
|
||||||
merge_request.update(merge_commit_sha: merge_commit_id)
|
# Artificially mark as completed.
|
||||||
|
merge_request.update(merge_commit_sha: merge_commit.id)
|
||||||
merge_commit
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it do
|
it do
|
||||||
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue