diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-11-30 11:34:59 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-12-08 19:28:57 +0100 |
commit | 0f00c7818bf09e800c4ac6652077fffe7976ed6b (patch) | |
tree | 6b960034e449444eb5afbf30e327ca454f4afdfd /spec/models/project_spec.rb | |
parent | 08942de9b6a3ad361cbae8a83a8e8b7c7e4768ec (diff) | |
download | gitlab-ce-0f00c7818bf09e800c4ac6652077fffe7976ed6b.tar.gz |
Remove resolving conditional from protected_for
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index a106642c3e5..75f1f779bb0 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2624,6 +2624,28 @@ describe Project do is_expected.to be_truthy end end + + context 'when ref name is a full branch ref' do + let(:ref) { 'refs/tags/something' } + + before do + project.repository.add_branch(project.creator, ref, 'master') + end + + it 'returns false' do + is_expected.to be_falsey + end + + context 'when ref is a protected branch' do + before do + create(:protected_branch, name: 'refs/tags/something', project: project) + end + + it 'returns true' do + is_expected.to be_truthy + end + end + end end describe '#update_project_statistics' do |