store.rb 777 B

1234567891011121314151617181920212223242526272829
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :store do
  4. object { 'UploadCache' }
  5. o_id { 1 }
  6. preferences { {} }
  7. created_by_id { 1 }
  8. txt
  9. trait :txt do
  10. filename { 'test.txt' }
  11. data { 'some content' }
  12. end
  13. trait :image do
  14. filename { '1x1.png' }
  15. preferences { { 'Content-Type' => "image/#{File.extname(filename).delete_prefix('.')}" } }
  16. data { Rails.root.join('test/data/image/1x1.png').binread }
  17. end
  18. trait :ics do
  19. filename { 'basic.ics' }
  20. preferences { { 'Content-Type' => 'text/calendar' } }
  21. data { Rails.root.join('spec/fixtures/files/calendar/basic.ics').binread }
  22. end
  23. end
  24. end