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.
This commit is contained in:
parent
4ddbbcd11a
commit
37651d2f4c
1 changed files with 3 additions and 3 deletions
|
@ -3,9 +3,9 @@ FactoryGirl.define do
|
||||||
name
|
name
|
||||||
project
|
project
|
||||||
|
|
||||||
after(:create) do |protected_branch|
|
before(:create) do |protected_branch|
|
||||||
protected_branch.push_access_levels.create!(access_level: Gitlab::Access::MASTER)
|
protected_branch.push_access_levels.new(access_level: Gitlab::Access::MASTER)
|
||||||
protected_branch.merge_access_levels.create!(access_level: Gitlab::Access::MASTER)
|
protected_branch.merge_access_levels.new(access_level: Gitlab::Access::MASTER)
|
||||||
end
|
end
|
||||||
|
|
||||||
trait :developers_can_push do
|
trait :developers_can_push do
|
||||||
|
|
Loading…
Reference in a new issue