diff options
author | Matt Jankowski <mjankowski@thoughtbot.com> | 2017-04-30 12:15:49 -0400 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-04-30 18:15:49 +0200 |
commit | 5259319cf5d01a23a0e9517b9dc91c0a1f7e2ae9 (patch) | |
tree | a03e530faceaeece832223db5104e1f32592133c /spec/models | |
parent | b83bc0ae6481bca70b75f4fb7128ac908612c658 (diff) |
Reports spec for media attachments, clean up method (#2660)
* Add coverage for Report#media_attachments * Direct query on media attachment
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/report_spec.rb | 11 |
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 |