Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-08-16 11:04:56 +0300
committerTimothy Andrew <mail@timothyandrew.net>2016-08-16 11:12:34 +0300
commitdd3b738d5b3eb70217d7ac7f9fe441498d2e8e7e (patch)
tree830a6a3693ef760b295f66c6f1ae4660d40df066 /spec/factories
parent37651d2f4ce12c16945a5b67360c67768cddb465 (diff)
Fix failing tests relating to backporting ee!581.
1. `GitPushService` was still using `{merge,push}_access_level_attributes` instead of `{merge,push}_access_levels_attributes`. 2. The branches API creates access levels regardless of the state of the `developers_can_{push,merge}` parameters. This is in line with the UI, where Master access is the default for a new protected branch. 3. Use `after(:build)` to create access levels in the `protected_branches` factory, so that `factories_spec` passes. It only builds records, so we need to create access levels on `build` as well.
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/protected_branches.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/factories/protected_branches.rb b/spec/factories/protected_branches.rb
index 42853cac112..b2695e0482a 100644
--- a/spec/factories/protected_branches.rb
+++ b/spec/factories/protected_branches.rb
@@ -3,7 +3,7 @@ FactoryGirl.define do
name
project
- before(:create) do |protected_branch|
+ after(:build) do |protected_branch|
protected_branch.push_access_levels.new(access_level: Gitlab::Access::MASTER)
protected_branch.merge_access_levels.new(access_level: Gitlab::Access::MASTER)
end