Commit 348e346d authored by Hiroyuki Sato's avatar Hiroyuki Sato

Fix false-positive spec

parent 74946c19
......@@ -197,6 +197,24 @@ describe MergeRequests::CreateService do
expect(merge_request.actual_head_pipeline).to be_merge_request
end
context 'when there are no commits between source branch and target branch' do
let(:opts) do
{
title: 'Awesome merge_request',
description: 'please fix',
source_branch: 'not-merged-branch',
target_branch: 'master'
}
end
it 'does not create a merge request pipeline' do
expect(merge_request).to be_persisted
merge_request.reload
expect(merge_request.merge_request_pipelines.count).to eq(0)
end
end
context "when branch pipeline was created before a merge request pipline has been created" do
before do
create(:ci_pipeline, project: merge_request.source_project,
......@@ -226,24 +244,6 @@ describe MergeRequests::CreateService do
end
end
context 'when there are no commits between source branch and target branch' do
let(:opts) do
{
title: 'Awesome merge_request',
description: 'please fix',
source_branch: 'not-merged-branch',
target_branch: 'master'
}
end
it 'does not create a merge request pipeline' do
expect(merge_request).to be_persisted
merge_request.reload
expect(merge_request.merge_request_pipelines.count).to eq(0)
end
end
context "when .gitlab-ci.yml does not have merge_requests keywords" do
let(:config) 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