Commit 2e3f2625 authored by Rubén Dávila Santos's avatar Rubén Dávila Santos

Merge branch 'sh-disable-default-access-levels-in-spec' into '8-12-stable-ee'

Disable default access level in protected branch spec

EE protected branches allow for multiple push and merge access levels per branch, whereas CE protected branches only allow one level per branch. The `ProtectedBranch` factory was by default adding Master access by default. This fix forces the spec to use one access level.


See merge request !745
parents 9f1d7f14 3fed8bc7
...@@ -278,7 +278,9 @@ describe GitPushService, services: true do ...@@ -278,7 +278,9 @@ describe GitPushService, services: true do
it "when pushing a branch for the first time with an existing branch permission configured" do it "when pushing a branch for the first time with an existing branch permission configured" do
stub_application_setting(default_branch_protection: Gitlab::Access::PROTECTION_DEV_CAN_PUSH) stub_application_setting(default_branch_protection: Gitlab::Access::PROTECTION_DEV_CAN_PUSH)
create(:protected_branch, :no_one_can_push, :developers_can_merge, project: project, name: 'master') create(:protected_branch, :no_one_can_push, :developers_can_merge,
:remove_default_access_levels,
project: project, name: 'master')
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")
expect_any_instance_of(ProtectedBranches::CreateService).not_to receive(:execute) expect_any_instance_of(ProtectedBranches::CreateService).not_to receive(:execute)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment