diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2016-08-16 12:45:48 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2016-08-16 12:45:48 +0530 |
commit | 37651d2f4ce12c16945a5b67360c67768cddb465 (patch) | |
tree | 4863def680454b8aa26bafedf6cd119094bb0a0d /spec/factories | |
parent | 4ddbbcd11a6f03ae36efd4b9016974c34a1465ed (diff) | |
download | gitlab-ce-37651d2f4ce12c16945a5b67360c67768cddb465.tar.gz |
Fix the protected branches factory.
1. Previously, we were using `after_create` to create access levels.
2. At the time of protected branch creation, there are _no_ access
levels present, which is invalid, and creation fails.
3. Fixed by setting access levels before the protected branch is created.
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/protected_branches.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/factories/protected_branches.rb b/spec/factories/protected_branches.rb index 3b21174987f..42853cac112 100644 --- a/spec/factories/protected_branches.rb +++ b/spec/factories/protected_branches.rb @@ -3,9 +3,9 @@ FactoryGirl.define do name project - after(:create) do |protected_branch| - protected_branch.push_access_levels.create!(access_level: Gitlab::Access::MASTER) - protected_branch.merge_access_levels.create!(access_level: Gitlab::Access::MASTER) + before(:create) 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 trait :developers_can_push do |