smime_certificate.rb 593 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :smime_certificate do
  4. created_at { Time.zone.now }
  5. updated_at { Time.zone.now }
  6. transient do
  7. fixture { nil }
  8. end
  9. public_key { Rails.root.join("spec/fixtures/files/smime/#{fixture}.crt").read if fixture }
  10. trait :with_private do
  11. private_key { Rails.root.join("spec/fixtures/files/smime/#{fixture}.key").read }
  12. private_key_secret { Rails.root.join("spec/fixtures/files/smime/#{fixture}.secret").read.strip! }
  13. end
  14. end
  15. end