gitlab-org--gitlab-foss/spec/factories/groups.rb

33 lines
699 B
Ruby
Raw Normal View History

FactoryGirl.define do
factory :group, class: Group, parent: :namespace do
sequence(:name) { |n| "group#{n}" }
path { name.downcase.gsub(/\s/, '_') }
type 'Group'
owner nil
2016-03-18 08:28:16 -04:00
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 { File.open(Rails.root.join('spec/fixtures/dk.png')) }
end
trait :access_requestable do
request_access_enabled true
end
trait :nested do
parent factory: :group
end
end
end