Files
codeocean/spec/factories/consumer.rb
Sebastian Serth 9c3392b324 Add consumer-based RfC Visibility settings
This setting will be useful to increase data protection, where users might not be allowed to see RfCs from other contexts.
2023-02-20 23:47:06 +01:00

19 lines
392 B
Ruby

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