Merge commit 'b896b16cb3c8626fbee12a7eda7f882114b1a040' into glitch-soc/merge-upstream
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user