gitlab-org--gitlab-foss/spec/factories/deploy_tokens.rb
Mayra Cabrera 0dd6d25c25 Rename special deploy token to make it more descriptive
Also:
- Includes more specs
- Improves a bit the documentation
2018-04-20 12:18:41 -05:00

22 lines
448 B
Ruby

FactoryBot.define do
factory :deploy_token do
token { SecureRandom.hex(50) }
sequence(:name) { |n| "PDT #{n}" }
read_repository true
read_registry true
revoked false
expires_at { 5.days.from_now }
trait :revoked do
revoked true
end
trait :gitlab_deploy_token do
name DeployToken::GITLAB_DEPLOY_TOKEN_NAME
end
trait :expired do
expires_at { Date.today - 1.month }
end
end
end