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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
427 B
Ruby
Raw Permalink Normal View History

2023-07-09 08:55:56 +05:30
# frozen_string_literal: true
FactoryBot.define do
factory :organization do
sequence(:name) { |n| "Organization ##{n}" }
trait :default do
id { Organization::DEFAULT_ORGANIZATION_ID }
name { 'Default' }
initialize_with do
# Ensure we only use one default organization
Organization.find_by(id: Organization::DEFAULT_ORGANIZATION_ID) || new(**attributes)
end
end
end
end