Extract shared examples from api specs (#25387)
This commit is contained in:
		
					parent
					
						
							
								ae2790d84f
							
						
					
				
			
			
				commit
				
					
						4c5f62de99
					
				
			
		
					 17 changed files with 23 additions and 256 deletions
				
			
		|  | @ -16,22 +16,6 @@ describe Api::V1::Admin::Trends::StatusesController do | |||
|     allow(controller).to receive(:doorkeeper_token) { token } | ||||
|   end | ||||
| 
 | ||||
|   shared_examples 'forbidden for wrong scope' do |wrong_scope| | ||||
|     let(:scopes) { wrong_scope } | ||||
| 
 | ||||
|     it 'returns http forbidden' do | ||||
|       expect(response).to have_http_status(403) | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|   shared_examples 'forbidden for wrong role' do |wrong_role| | ||||
|     let(:role) { UserRole.find_by(name: wrong_role) } | ||||
| 
 | ||||
|     it 'returns http forbidden' do | ||||
|       expect(response).to have_http_status(403) | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|   describe 'GET #index' do | ||||
|     it 'returns http success' do | ||||
|       get :index, params: { account_id: account.id, limit: 2 } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue