mirror of
https://github.com/gitlabhq/gitlabhq.git
synced 2025-07-23 00:45:28 +00:00
29 lines
608 B
Ruby
29 lines
608 B
Ruby
# frozen_string_literal: true
|
|
|
|
FactoryBot.define do
|
|
factory :oauth_application, class: 'Doorkeeper::Application', aliases: [:application] do
|
|
sequence(:name) { |n| "OAuth App #{n}" }
|
|
uid { Doorkeeper::OAuth::Helpers::UniqueToken.generate }
|
|
redirect_uri { generate(:url) }
|
|
owner
|
|
owner_type { 'User' }
|
|
end
|
|
|
|
trait :group_owned do
|
|
owner_type { 'Group' }
|
|
owner { association(:group) }
|
|
end
|
|
|
|
trait :dynamic do
|
|
owner { nil }
|
|
owner_type { nil }
|
|
dynamic { true }
|
|
end
|
|
|
|
trait :without_owner do
|
|
owner { nil }
|
|
owner_type { nil }
|
|
dynamic { false }
|
|
end
|
|
end
|