diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-06-20 14:15:28 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-20 14:15:28 +0000 |
commit | a5245fd8b842c0d87161254cfa6ef257f9d22ed9 (patch) | |
tree | 138e170b7956476b75f8938f7817e2a4192f81e8 /spec | |
parent | 00518d261d2e5b751bb5da93531880d4b3eb4250 (diff) | |
parent | 46b56b18f5bf94662a8500e2b8789f504b5d6ea8 (diff) | |
download | gitlab-ce-a5245fd8b842c0d87161254cfa6ef257f9d22ed9.tar.gz |
Merge branch 'zj-can-be-merged' into 'master'
Move mergablility check to Gitaly
Closes gitaly#889
See merge request gitlab-org/gitlab-ce!20019
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/repository_spec.rb | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index b6df048d4ca..d817a8376f4 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -434,44 +434,34 @@ describe Repository do end describe '#can_be_merged?' do - shared_examples 'can be merged' do - context 'mergeable branches' do - subject { repository.can_be_merged?('0b4bc9a49b562e85de7cc9e834518ea6828729b9', 'master') } + context 'mergeable branches' do + subject { repository.can_be_merged?('0b4bc9a49b562e85de7cc9e834518ea6828729b9', 'master') } - it { is_expected.to be_truthy } - end - - context 'non-mergeable branches without conflict sides missing' do - subject { repository.can_be_merged?('bb5206fee213d983da88c47f9cf4cc6caf9c66dc', 'feature') } - - it { is_expected.to be_falsey } - end + it { is_expected.to be_truthy } + end - context 'non-mergeable branches with conflict sides missing' do - subject { repository.can_be_merged?('conflict-missing-side', 'conflict-start') } + context 'non-mergeable branches without conflict sides missing' do + subject { repository.can_be_merged?('bb5206fee213d983da88c47f9cf4cc6caf9c66dc', 'feature') } - it { is_expected.to be_falsey } - end + it { is_expected.to be_falsey } + end - context 'non merged branch' do - subject { repository.merged_to_root_ref?('fix') } + context 'non-mergeable branches with conflict sides missing' do + subject { repository.can_be_merged?('conflict-missing-side', 'conflict-start') } - it { is_expected.to be_falsey } - end + it { is_expected.to be_falsey } + end - context 'non existent branch' do - subject { repository.merged_to_root_ref?('non_existent_branch') } + context 'non merged branch' do + subject { repository.merged_to_root_ref?('fix') } - it { is_expected.to be_nil } - end + it { is_expected.to be_falsey } end - context 'when Gitaly can_be_merged feature is enabled' do - it_behaves_like 'can be merged' - end + context 'non existent branch' do + subject { repository.merged_to_root_ref?('non_existent_branch') } - context 'when Gitaly can_be_merged feature is disabled', :disable_gitaly do - it_behaves_like 'can be merged' + it { is_expected.to be_nil } end end |