diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-23 12:10:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-23 12:10:03 +0300 |
commit | 65f7976d0cd11d91a4c0945b2c63a1aa2f888b07 (patch) | |
tree | 07a0e774b12b29352ca6b3bd87b108879ebb00b9 /spec/factories/gitlab/jwt_token.rb | |
parent | 1165608bfd217a96e133487d6049a989a15789c4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories/gitlab/jwt_token.rb')
-rw-r--r-- | spec/factories/gitlab/jwt_token.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/factories/gitlab/jwt_token.rb b/spec/factories/gitlab/jwt_token.rb new file mode 100644 index 00000000000..bc00c6a5ff4 --- /dev/null +++ b/spec/factories/gitlab/jwt_token.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :jwt_token, class: 'Gitlab::JWTToken' do + skip_create + + initialize_with { new } + + trait :with_custom_payload do + transient do + custom_payload { {} } + end + + after(:build) do |jwt, evaluator| + evaluator.custom_payload.each do |key, value| + jwt[key] = value + end + end + end + end +end |