diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-19 19:14:53 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-22 13:13:47 +0300 |
commit | 7460c39f60bcf326dee062bdf3aa2ddda38e86e5 (patch) | |
tree | 2e06488ecbd8cf2c55d68e2f79d0bdfebb88c63e /spec/services | |
parent | 2120e2dd95dbbab81c4b818d6d860139bb6c5f0b (diff) |
Fix GitPushService spec
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/git_push_service_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb index dfbece18cdc..435b14eb245 100644 --- a/spec/services/git_push_service_spec.rb +++ b/spec/services/git_push_service_spec.rb @@ -124,8 +124,9 @@ describe GitPushService do end it "when pushing a branch for the first time with default branch protection disabled" do - allow_any_instance_of(ApplicationSetting). - to receive(:default_branch_protection).and_return(0) + allow(ApplicationSetting.current_application_settings). + to receive(:default_branch_protection). + and_return(Gitlab::Access::PROTECTION_NONE) expect(project).to receive(:execute_hooks) expect(project.default_branch).to eq("master") @@ -134,8 +135,9 @@ describe GitPushService do end it "when pushing a branch for the first time with default branch protection set to 'developers can push'" do - allow_any_instance_of(ApplicationSetting). - to receive(:default_branch_protection).and_return(1) + allow(ApplicationSetting.current_application_settings). + to receive(:default_branch_protection). + and_return(Gitlab::Access::PROTECTION_DEV_CAN_PUSH) expect(project).to receive(:execute_hooks) expect(project.default_branch).to eq("master") |