smime_certificate.rb 522 B

1234567891011121314151617
  1. FactoryBot.define do
  2. factory :smime_certificate do
  3. created_at { Time.zone.now }
  4. updated_at { Time.zone.now }
  5. transient do
  6. fixture { nil }
  7. end
  8. public_key { File.read( Rails.root.join("spec/fixtures/smime/#{fixture}.crt") ) if fixture }
  9. trait :with_private do
  10. private_key { File.read( Rails.root.join("spec/fixtures/smime/#{fixture}.key") ) }
  11. private_key_secret { File.read( Rails.root.join("spec/fixtures/smime/#{fixture}.secret") ).strip! }
  12. end
  13. end
  14. end