Extract authorization policy for viewing statuses (#3150)
This commit is contained in:
		
					parent
					
						
							
								9a81be0d37
							
						
					
				
			
			
				commit
				
					
						3a2003ba86
					
				
			
		
					 16 changed files with 155 additions and 80 deletions
				
			
		|  | @ -30,7 +30,7 @@ describe MediaController do | |||
|     it 'raises when not permitted to view' do | ||||
|       status = Fabricate(:status) | ||||
|       media_attachment = Fabricate(:media_attachment, status: status) | ||||
|       allow_any_instance_of(Status).to receive(:permitted?).and_return(false) | ||||
|       allow_any_instance_of(MediaController).to receive(:authorize).and_raise(ActiveRecord::RecordNotFound) | ||||
|       get :show, params: { id: media_attachment.to_param } | ||||
| 
 | ||||
|       expect(response).to have_http_status(:missing) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue