debian-mirror-gitlab/spec/factories/groups.rb

33 lines
699 B
Ruby
Raw Normal View History

2016-06-02 11:05:42 +05:30
FactoryGirl.define do
2017-08-17 22:00:37 +05:30
factory :group, class: Group, parent: :namespace do
2016-06-02 11:05:42 +05:30
sequence(:name) { |n| "group#{n}" }
path { name.downcase.gsub(/\s/, '_') }
type 'Group'
2017-08-17 22:00:37 +05:30
owner nil
2016-06-02 11:05:42 +05:30
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
2017-08-17 22:00:37 +05:30
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
2016-06-02 11:05:42 +05:30
end
end