Welcome to mirror list, hosted at ThFree Co, Russian Federation.

jwt_token.rb « gitlab « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bc00c6a5ff41fcf841febd3f6ccc491740786330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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