0
0
Fork 0

Fix media attachments without file being uploadable (#12562)

Fix #12554
This commit is contained in:
Eugen Rochko 2020-01-23 21:40:03 +01:00 committed by GitHub
parent 43daeccccb
commit 81cc86bb1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 21 deletions

View file

@ -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(