gitlab-org--gitlab-foss/spec/factories/groups.rb
Kamil Trzciński 8af23def1d Revert "Merge branch '3867-port-to-ce' into 'master'"
This reverts commit 54a575f1bb, reversing
changes made to c63af942e5.
2018-02-28 21:09:34 +01:00

32 lines
691 B
Ruby

FactoryBot.define do
factory :group, class: Group, parent: :namespace do
sequence(:name) { |n| "group#{n}" }
path { name.downcase.gsub(/\s/, '_') }
type 'Group'
owner nil
trait :public do
visibility_level Gitlab::VisibilityLevel::PUBLIC
end
trait :internal do
visibility_level Gitlab::VisibilityLevel::INTERNAL
end
trait :private do
visibility_level Gitlab::VisibilityLevel::PRIVATE
end
trait :with_avatar do
avatar { fixture_file_upload('spec/fixtures/dk.png') }
end
trait :access_requestable do
request_access_enabled true
end
trait :nested do
parent factory: :group
end
end
end