From e6bb4bd747a0120dd0207aecbb7c5c67b7caa165 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 23 Jan 2020 21:40:03 +0100 Subject: port tootsuite#12562 to monsterfork: Fix media attachments without file being uploadable Fix #12554 --- spec/services/post_status_service_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'spec/services/post_status_service_spec.rb') diff --git a/spec/services/post_status_service_spec.rb b/spec/services/post_status_service_spec.rb index e120d78e8..9a579a693 100644 --- a/spec/services/post_status_service_spec.rb +++ b/spec/services/post_status_service_spec.rb @@ -214,14 +214,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