Move api/v1/timelines/list to request spec (#28948)
				
					
				
			This commit is contained in:
		
							parent
							
								
									87ad398ddc
								
							
						
					
					
						commit
						0b0ca6f3b8
					
				| @ -2,20 +2,17 @@ | ||||
| 
 | ||||
| require 'rails_helper' | ||||
| 
 | ||||
| describe Api::V1::Timelines::ListController do | ||||
|   render_views | ||||
| 
 | ||||
| describe 'API V1 Timelines List' do | ||||
|   let(:user) { Fabricate(:user) } | ||||
|   let(:scopes)  { 'read:statuses' } | ||||
|   let(:token)   { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) } | ||||
|   let(:headers) { { 'Authorization' => "Bearer #{token.token}" } } | ||||
|   let(:list) { Fabricate(:list, account: user.account) } | ||||
| 
 | ||||
|   before do | ||||
|     allow(controller).to receive(:doorkeeper_token) { token } | ||||
|   end | ||||
| 
 | ||||
|   context 'with a user context' do | ||||
|     let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read:lists') } | ||||
| 
 | ||||
|     describe 'GET #show' do | ||||
|     describe 'GET /api/v1/timelines/list/:id' do | ||||
|       before do | ||||
|         follow = Fabricate(:follow, account: user.account) | ||||
|         list.accounts << follow.target_account | ||||
| @ -23,7 +20,8 @@ describe Api::V1::Timelines::ListController do | ||||
|       end | ||||
| 
 | ||||
|       it 'returns http success' do | ||||
|         get :show, params: { id: list.id } | ||||
|         get "/api/v1/timelines/list/#{list.id}", headers: headers | ||||
| 
 | ||||
|         expect(response).to have_http_status(200) | ||||
|       end | ||||
|     end | ||||
| @ -35,7 +33,8 @@ describe Api::V1::Timelines::ListController do | ||||
| 
 | ||||
|     describe 'GET #show' do | ||||
|       it 'returns http not found' do | ||||
|         get :show, params: { id: list.id } | ||||
|         get "/api/v1/timelines/list/#{list.id}", headers: headers | ||||
| 
 | ||||
|         expect(response).to have_http_status(404) | ||||
|       end | ||||
|     end | ||||
| @ -46,7 +45,7 @@ describe Api::V1::Timelines::ListController do | ||||
| 
 | ||||
|     describe 'GET #show' do | ||||
|       it 'returns http unprocessable entity' do | ||||
|         get :show, params: { id: list.id } | ||||
|         get "/api/v1/timelines/list/#{list.id}", headers: headers | ||||
| 
 | ||||
|         expect(response).to have_http_status(422) | ||||
|         expect(response.headers['Link']).to be_nil | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user