From 490bdb7944fd2fe323494b3bbd60130673ccfa33 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 3 Sep 2024 11:34:09 -0400 Subject: [PATCH] Add coverage for `StatusesHelper#media_summary` method (#31726) --- spec/helpers/statuses_helper_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/helpers/statuses_helper_spec.rb b/spec/helpers/statuses_helper_spec.rb index b7531ec0b7..66eb996f99 100644 --- a/spec/helpers/statuses_helper_spec.rb +++ b/spec/helpers/statuses_helper_spec.rb @@ -23,6 +23,19 @@ describe StatusesHelper do end end + describe '#media_summary' do + it 'describes the media on a status' do + status = Fabricate :status + Fabricate :media_attachment, status: status, type: :video + Fabricate :media_attachment, status: status, type: :audio + Fabricate :media_attachment, status: status, type: :image + + result = helper.media_summary(status) + + expect(result).to eq('Attached: 1 image · 1 video · 1 audio') + end + end + describe 'fa_visibility_icon' do context 'with a status that is public' do let(:status) { Status.new(visibility: 'public') }