Commit 37651d2f authored by Timothy Andrew's avatar Timothy Andrew

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.
parent 4ddbbcd1
......@@ -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
......
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