report_spec.rb 697 B

123456789101112131415161718192021222324
  1. require 'rails_helper'
  2. describe Report do
  3. describe 'statuses' do
  4. it 'returns the statuses for the report' do
  5. status = Fabricate(:status)
  6. _other = Fabricate(:status)
  7. report = Fabricate(:report, status_ids: [status.id])
  8. expect(report.statuses).to eq [status]
  9. end
  10. end
  11. describe 'media_attachments' do
  12. it 'returns media attachments from statuses' do
  13. status = Fabricate(:status)
  14. media_attachment = Fabricate(:media_attachment, status: status)
  15. _other_media_attachment = Fabricate(:media_attachment)
  16. report = Fabricate(:report, status_ids: [status.id])
  17. expect(report.media_attachments).to eq [media_attachment]
  18. end
  19. end
  20. end