about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/models/report_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/report_spec.rb b/spec/models/report_spec.rb
index 80b8cc55b..6c2723845 100644
--- a/spec/models/report_spec.rb
+++ b/spec/models/report_spec.rb
@@ -10,4 +10,15 @@ describe Report do
       expect(report.statuses).to eq [status]
     end
   end
+
+  describe 'media_attachments' do
+    it 'returns media attachments from statuses' do
+      status = Fabricate(:status)
+      media_attachment = Fabricate(:media_attachment, status: status)
+      _other_media_attachment = Fabricate(:media_attachment)
+      report = Fabricate(:report, status_ids: [status.id])
+
+      expect(report.media_attachments).to eq [media_attachment]
+    end
+  end
 end