Fix GitPushService spec
This commit is contained in:
parent
2120e2dd95
commit
7460c39f60
1 changed files with 6 additions and 4 deletions
|
@ -124,8 +124,9 @@ describe GitPushService do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "when pushing a branch for the first time with default branch protection disabled" do
|
it "when pushing a branch for the first time with default branch protection disabled" do
|
||||||
allow_any_instance_of(ApplicationSetting).
|
allow(ApplicationSetting.current_application_settings).
|
||||||
to receive(:default_branch_protection).and_return(0)
|
to receive(:default_branch_protection).
|
||||||
|
and_return(Gitlab::Access::PROTECTION_NONE)
|
||||||
|
|
||||||
expect(project).to receive(:execute_hooks)
|
expect(project).to receive(:execute_hooks)
|
||||||
expect(project.default_branch).to eq("master")
|
expect(project.default_branch).to eq("master")
|
||||||
|
@ -134,8 +135,9 @@ describe GitPushService do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "when pushing a branch for the first time with default branch protection set to 'developers can push'" do
|
it "when pushing a branch for the first time with default branch protection set to 'developers can push'" do
|
||||||
allow_any_instance_of(ApplicationSetting).
|
allow(ApplicationSetting.current_application_settings).
|
||||||
to receive(:default_branch_protection).and_return(1)
|
to receive(:default_branch_protection).
|
||||||
|
and_return(Gitlab::Access::PROTECTION_DEV_CAN_PUSH)
|
||||||
|
|
||||||
expect(project).to receive(:execute_hooks)
|
expect(project).to receive(:execute_hooks)
|
||||||
expect(project.default_branch).to eq("master")
|
expect(project.default_branch).to eq("master")
|
||||||
|
|
Loading…
Reference in a new issue