0
0
Fork 0

Merge branch 'main' into glitch-soc/merge-upstream

This commit is contained in:
Claire 2021-03-24 10:53:50 +01:00
commit f60c99a8fb
53 changed files with 684 additions and 404 deletions

View file

@ -30,8 +30,8 @@ describe Api::V1::Accounts::CredentialsController do
patch :update, params: {
display_name: "Alice Isn't Dead",
note: "Hi!\n\nToot toot!",
avatar: fixture_file_upload('files/avatar.gif', 'image/gif'),
header: fixture_file_upload('files/attachment.jpg', 'image/jpeg'),
avatar: fixture_file_upload('avatar.gif', 'image/gif'),
header: fixture_file_upload('attachment.jpg', 'image/jpeg'),
source: {
privacy: 'unlisted',
sensitive: true,

View file

@ -15,7 +15,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do
context 'when imagemagick cant identify the file type' do
before 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('files/attachment.jpg', 'image/jpeg') }
post :create, params: { file: fixture_file_upload('attachment.jpg', 'image/jpeg') }
end
it 'returns http 422' do
@ -26,7 +26,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do
context 'when there is a generic error' do
before do
expect_any_instance_of(Account).to receive_message_chain(:media_attachments, :create!).and_raise(Paperclip::Error)
post :create, params: { file: fixture_file_upload('files/attachment.jpg', 'image/jpeg') }
post :create, params: { file: fixture_file_upload('attachment.jpg', 'image/jpeg') }
end
it 'returns http 422' do
@ -37,7 +37,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do
context 'image/jpeg' do
before do
post :create, params: { file: fixture_file_upload('files/attachment.jpg', 'image/jpeg') }
post :create, params: { file: fixture_file_upload('attachment.jpg', 'image/jpeg') }
end
it 'returns http success' do
@ -59,7 +59,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do
context 'image/gif' do
before do
post :create, params: { file: fixture_file_upload('files/attachment.gif', 'image/gif') }
post :create, params: { file: fixture_file_upload('attachment.gif', 'image/gif') }
end
it 'returns http success' do
@ -81,7 +81,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do
context 'video/webm' do
before do
post :create, params: { file: fixture_file_upload('files/attachment.webm', 'video/webm') }
post :create, params: { file: fixture_file_upload('attachment.webm', 'video/webm') }
end
it do