2018-03-19 16:11:12 +00:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :deploy_token do
|
|
|
|
token { SecureRandom.hex(50) }
|
|
|
|
sequence(:name) { |n| "PDT #{n}" }
|
2018-04-05 17:22:34 +00:00
|
|
|
read_repository true
|
|
|
|
read_registry true
|
2018-03-19 16:11:12 +00:00
|
|
|
revoked false
|
|
|
|
expires_at { 5.days.from_now }
|
|
|
|
|
|
|
|
trait :revoked do
|
|
|
|
revoked true
|
|
|
|
end
|
2018-04-16 20:47:35 +00:00
|
|
|
|
|
|
|
trait :gitlab_deploy_token do
|
2018-04-18 17:25:57 +00:00
|
|
|
name DeployToken::GITLAB_DEPLOY_TOKEN_NAME
|
2018-04-16 20:47:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
trait :expired do
|
|
|
|
expires_at { Date.today - 1.month }
|
|
|
|
end
|
2018-03-19 16:11:12 +00:00
|
|
|
end
|
|
|
|
end
|