diff options
author | Robert Speicher <robert@gitlab.com> | 2018-05-02 22:11:45 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-05-02 22:11:45 +0300 |
commit | ab6dd3ac57dfff6472f6ecac21154fada9aa8d65 (patch) | |
tree | 36273df1ba7754757a2eb34454d61fd64c40a55a /spec/models/project_spec.rb | |
parent | b01221cc9e02c09fa259a5c4c71eb559e77816fe (diff) | |
parent | 9ec4b5c9b65f40a71ca94d2f318da4adf9309a2e (diff) |
Merge branch '10-7-stable-patch-3' into '10-7-stable'
Prepare 10.7.3 release
See merge request gitlab-org/gitlab-ce!18647
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 2675c2f52c1..e3053a2b86e 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1483,52 +1483,6 @@ describe Project do end end - describe '#user_can_push_to_empty_repo?' do - let(:project) { create(:project) } - let(:user) { create(:user) } - - it 'returns false when default_branch_protection is in full protection and user is developer' do - project.add_developer(user) - stub_application_setting(default_branch_protection: Gitlab::Access::PROTECTION_FULL) - - expect(project.user_can_push_to_empty_repo?(user)).to be_falsey - end - - it 'returns false when default_branch_protection only lets devs merge and user is dev' do - project.add_developer(user) - stub_application_setting(default_branch_protection: Gitlab::Access::PROTECTION_DEV_CAN_MERGE) - - expect(project.user_can_push_to_empty_repo?(user)).to be_falsey - end - - it 'returns true when default_branch_protection lets devs push and user is developer' do - project.add_developer(user) - stub_application_setting(default_branch_protection: Gitlab::Access::PROTECTION_DEV_CAN_PUSH) - - expect(project.user_can_push_to_empty_repo?(user)).to be_truthy - end - - it 'returns true when default_branch_protection is unprotected and user is developer' do - project.add_developer(user) - stub_application_setting(default_branch_protection: Gitlab::Access::PROTECTION_NONE) - - expect(project.user_can_push_to_empty_repo?(user)).to be_truthy - end - - it 'returns true when user is master' do - project.add_master(user) - - expect(project.user_can_push_to_empty_repo?(user)).to be_truthy - end - - it 'returns false when the repo is not empty' do - project.add_master(user) - expect(project).to receive(:empty_repo?).and_return(false) - - expect(project.user_can_push_to_empty_repo?(user)).to be_falsey - end - end - describe '#container_registry_url' do let(:project) { create(:project) } |