Commit 13aa6f67 authored by Mark Chao's avatar Mark Chao

Add spec

parent b1ab1609
...@@ -1245,8 +1245,7 @@ describe MergeRequest do ...@@ -1245,8 +1245,7 @@ describe MergeRequest do
describe '#check_if_can_be_merged' do describe '#check_if_can_be_merged' do
let(:project) { create(:project, only_allow_merge_if_pipeline_succeeds: true) } let(:project) { create(:project, only_allow_merge_if_pipeline_succeeds: true) }
subject { create(:merge_request, source_project: project, merge_status: :unchecked) } shared_examples 'checking if can be merged' do
context 'when it is not broken and has no conflicts' do context 'when it is not broken and has no conflicts' do
before do before do
allow(subject).to receive(:broken?) { false } allow(subject).to receive(:broken?) { false }
...@@ -1280,6 +1279,19 @@ describe MergeRequest do ...@@ -1280,6 +1279,19 @@ describe MergeRequest do
end end
end end
context 'when merge_status is unchecked' do
subject { create(:merge_request, source_project: project, merge_status: :unchecked) }
it_behaves_like 'checking if can be merged'
end
context 'when merge_status is unchecked' do
subject { create(:merge_request, source_project: project, merge_status: :cannot_be_merged_recheck) }
it_behaves_like 'checking if can be merged'
end
end
describe '#mergeable?' do describe '#mergeable?' do
let(:project) { create(:project) } let(:project) { create(:project) }
......
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