Commit e6220c01 authored by Saverio Miroddi's avatar Saverio Miroddi

Add UT for cherry-pick of an existing merge that is not found

parent 83417865
......@@ -212,25 +212,27 @@ eos
{ message: 'Test message', committer: author, author: author }
end
let(:merge_commit) do
merge_request = create(:merge_request,
let(:merge_request) do
create(:merge_request,
source_branch: 'video',
target_branch: 'master',
source_project: project,
author: user)
end
let(:merge_commit) do
merge_commit_id = repository.merge(user,
merge_request.diff_head_sha,
merge_request,
commit_options)
merge_commit = repository.commit(merge_commit_id)
# Manually mark as completed.
#
merge_request.update(merge_commit_sha: merge_commit_id)
repository.commit(merge_commit_id)
end
merge_commit
context 'that is found' do
before do
# Artificially mark as completed.
merge_request.update(merge_commit_sha: merge_commit.id)
end
it do
......@@ -245,6 +247,15 @@ eos
expect(merge_commit.cherry_pick_message(user)).to include(expected_appended_text)
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
describe '#reverts_commit?' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment