Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `.github/workflows/build-image.yml`: Upstream attempted something with tags. Kept our version.
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								spec/fixtures/files/attachment-jpg.123456_abcd
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								spec/fixtures/files/attachment-jpg.123456_abcd
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 60 KiB | 
							
								
								
									
										18
									
								
								spec/requests/api/v2/media_spec.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								spec/requests/api/v2/media_spec.rb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| # frozen_string_literal: true | ||||
|  | ||||
| require 'rails_helper' | ||||
|  | ||||
| RSpec.describe 'Media API', paperclip_processing: true do | ||||
|   let(:user)    { Fabricate(:user) } | ||||
|   let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } | ||||
|   let(:scopes)  { 'write' } | ||||
|   let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } | ||||
|  | ||||
|   describe 'POST /api/v2/media' do | ||||
|     it 'returns http success' do | ||||
|       post '/api/v2/media', headers: headers, params: { file: fixture_file_upload('attachment-jpg.123456_abcd', 'image/jpeg') } | ||||
|       expect(File.exist?(user.account.media_attachments.first.file.path(:small))).to be true | ||||
|       expect(response).to have_http_status(200) | ||||
|     end | ||||
|   end | ||||
| end | ||||
		Reference in New Issue
	
	Block a user