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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
404 B
Ruby
Raw Normal View History

2021-06-08 01:23:25 +05:30
# 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