Files
codeocean/spec/factories/consumer.rb
2022-09-22 19:24:26 +02:00

18 lines
368 B
Ruby

# frozen_string_literal: true
FactoryBot.define do
factory :consumer do
name { 'openHPI' }
singleton_consumer
end
trait :singleton_consumer do
initialize_with do
Consumer.find_or_initialize_by(name: name) do |consumer|
consumer.oauth_key = SecureRandom.hex
consumer.oauth_secret = SecureRandom.hex
end
end
end
end