Merge commit 'b896b16cb3c8626fbee12a7eda7f882114b1a040' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2023-05-28 15:01:53 +02:00
40 changed files with 227 additions and 216 deletions

View File

@@ -43,7 +43,7 @@ describe Api::V1::Accounts::NotesController do
it 'does not create account note' do
subject
expect(AccountNote.where(account_id: user.account.id, target_account_id: account.id).exists?).to be_falsey
expect(AccountNote.where(account_id: user.account.id, target_account_id: account.id)).to_not exist
end
end
end

View File

@@ -15,23 +15,19 @@ RSpec.describe Api::V1::MediaController do
describe 'POST #create' do
describe 'with paperclip errors' do
context 'when imagemagick cant identify the file type' do
before do
it 'returns http 422' do
expect_any_instance_of(Account).to receive_message_chain(:media_attachments, :create!).and_raise(Paperclip::Errors::NotIdentifiedByImageMagickError)
post :create, params: { file: fixture_file_upload('attachment.jpg', 'image/jpeg') }
end
it 'returns http 422' do
expect(response).to have_http_status(422)
end
end
context 'when there is a generic error' do
before do
it 'returns http 422' do
expect_any_instance_of(Account).to receive_message_chain(:media_attachments, :create!).and_raise(Paperclip::Error)
post :create, params: { file: fixture_file_upload('attachment.jpg', 'image/jpeg') }
end
it 'returns http 422' do
expect(response).to have_http_status(500)
end
end