diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-08-16 09:30:56 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-08-16 09:38:10 +0300 |
commit | 4ddbbcd11a6f03ae36efd4b9016974c34a1465ed (patch) | |
tree | 5d4386bbcf91a490f3402f7a1a74a4e0084cc50a /spec/services/git_push_service_spec.rb | |
parent | e9f483355ef07a63d664126c1200762bd1e11271 (diff) |
Improve EE compatibility with protected branch access levels.
1. Change a few incorrect `access_level` to `access_levels.first` that
were missed in e805a64.
2. `API::Entities` can iterate over all access levels instead of just
the first one. This makes no difference to CE, and makes it more compatible
with EE.
Diffstat (limited to 'spec/services/git_push_service_spec.rb')
-rw-r--r-- | spec/services/git_push_service_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb index 850b45f84f9..7585623b5ef 100644 --- a/spec/services/git_push_service_spec.rb +++ b/spec/services/git_push_service_spec.rb @@ -227,7 +227,7 @@ describe GitPushService, services: true do expect(project.default_branch).to eq("master") execute_service(project, user, @blankrev, 'newrev', 'refs/heads/master' ) expect(project.protected_branches).not_to be_empty - expect(project.protected_branches.first.push_access_level.access_level).to eq(Gitlab::Access::MASTER) + expect(project.protected_branches.first.push_access_levels.first.access_level).to eq(Gitlab::Access::MASTER) expect(project.protected_branches.first.merge_access_levels.first.access_level).to eq(Gitlab::Access::MASTER) end @@ -249,7 +249,7 @@ describe GitPushService, services: true do execute_service(project, user, @blankrev, 'newrev', 'refs/heads/master' ) expect(project.protected_branches).not_to be_empty - expect(project.protected_branches.last.push_access_level.access_level).to eq(Gitlab::Access::DEVELOPER) + expect(project.protected_branches.last.push_access_levels.first.access_level).to eq(Gitlab::Access::DEVELOPER) expect(project.protected_branches.last.merge_access_levels.first.access_level).to eq(Gitlab::Access::MASTER) end @@ -260,7 +260,7 @@ describe GitPushService, services: true do expect(project.default_branch).to eq("master") execute_service(project, user, @blankrev, 'newrev', 'refs/heads/master' ) expect(project.protected_branches).not_to be_empty - expect(project.protected_branches.first.push_access_level.access_level).to eq(Gitlab::Access::MASTER) + expect(project.protected_branches.first.push_access_levels.first.access_level).to eq(Gitlab::Access::MASTER) expect(project.protected_branches.first.merge_access_levels.first.access_level).to eq(Gitlab::Access::DEVELOPER) end |