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

25 lines
479 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-05-09 12:01:36 +05:30
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
2018-10-15 14:42:47 +05:30
trait :gitlab_deploy_token do
name DeployToken::GITLAB_DEPLOY_TOKEN_NAME
end
trait :expired do
expires_at { Date.today - 1.month }
end
2018-05-09 12:01:36 +05:30
end
end