From 81cc86bb1ffb662843938379eeb522e3a6f11b79 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 23 Jan 2020 21:40:03 +0100 Subject: Fix media attachments without file being uploadable (#12562) Fix #12554 --- spec/services/post_status_service_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'spec/services') diff --git a/spec/services/post_status_service_spec.rb b/spec/services/post_status_service_spec.rb index bf06f50e9..025a3da40 100644 --- a/spec/services/post_status_service_spec.rb +++ b/spec/services/post_status_service_spec.rb @@ -212,14 +212,18 @@ RSpec.describe PostStatusService, type: :service do it 'does not allow attaching both videos and images' do account = Fabricate(:account) + video = Fabricate(:media_attachment, type: :video, account: account) + image = Fabricate(:media_attachment, type: :image, account: account) + + video.update(type: :video) expect do subject.call( account, text: "test status update", media_ids: [ - Fabricate(:media_attachment, type: :video, account: account), - Fabricate(:media_attachment, type: :image, account: account), + video, + image, ].map(&:id), ) end.to raise_error( -- cgit