diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-03-19 19:11:12 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2018-04-07 05:20:16 +0300 |
commit | db18993f652425b72c4b854e18a002e0ec44b196 (patch) | |
tree | 7466e5f6b154bd79e72c13a5021d92eb9d7e4a13 /spec/factories/deploy_tokens.rb | |
parent | aade8b3652573db40e7b777c72caa922b0bc12ef (diff) |
Create barebones for Deploytoken
Includes:
- Model, factories, create service and controller actions
- As usual, includes specs for everything
- Builds UI (copy from PAT)
- Add revoke action
Closes #31591
Diffstat (limited to 'spec/factories/deploy_tokens.rb')
-rw-r--r-- | spec/factories/deploy_tokens.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/factories/deploy_tokens.rb b/spec/factories/deploy_tokens.rb new file mode 100644 index 00000000000..fa349e10ddc --- /dev/null +++ b/spec/factories/deploy_tokens.rb @@ -0,0 +1,22 @@ +FactoryBot.define do + factory :deploy_token do + project + token { SecureRandom.hex(50) } + sequence(:name) { |n| "PDT #{n}" } + revoked false + expires_at { 5.days.from_now } + scopes %w(read_repo read_registry) + + trait :revoked do + revoked true + end + + trait :read_repo do + scopes ['read_repo'] + end + + trait :read_registry do + scopes ['read_registry'] + end + end +end |