2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2020-06-02 11:01:16 +00:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :smime_certificate do
|
|
|
|
created_at { Time.zone.now }
|
|
|
|
updated_at { Time.zone.now }
|
|
|
|
|
|
|
|
transient do
|
|
|
|
fixture { nil }
|
|
|
|
end
|
|
|
|
|
2021-07-16 13:38:01 +00:00
|
|
|
public_key { File.read(Rails.root.join("spec/fixtures/smime/#{fixture}.crt")) if fixture }
|
2020-06-02 11:01:16 +00:00
|
|
|
|
|
|
|
trait :with_private do
|
2021-07-16 13:38:01 +00:00
|
|
|
private_key { File.read(Rails.root.join("spec/fixtures/smime/#{fixture}.key")) }
|
|
|
|
private_key_secret { File.read(Rails.root.join("spec/fixtures/smime/#{fixture}.secret")).strip! }
|
2020-06-02 11:01:16 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|