| 
									
										
										
										
											2016-06-23 09:47:54 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-02 12:12:46 -08:00
										 |  |  | import {describe, expect, it} from '@angular/core/testing/src/testing_internal'; | 
					
						
							| 
									
										
										
										
											2016-04-13 19:07:20 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-17 15:10:54 -08:00
										 |  |  | import {ResponseOptions} from '@angular/http/src/base_response_options'; | 
					
						
							|  |  |  | import {Response} from '@angular/http/src/static_response'; | 
					
						
							| 
									
										
										
										
											2016-04-13 19:07:20 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-16 14:42:55 -08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2016-04-13 19:07:20 -04:00
										 |  |  |   describe('Response', () => { | 
					
						
							|  |  |  |     it('should be ok for 200 statuses', () => { | 
					
						
							|  |  |  |       expect(new Response(new ResponseOptions({status: 200})).ok).toEqual(true); | 
					
						
							|  |  |  |       expect(new Response(new ResponseOptions({status: 299})).ok).toEqual(true); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should not be ok for non 200 statuses', () => { | 
					
						
							|  |  |  |       expect(new Response(new ResponseOptions({status: 199})).ok).toEqual(false); | 
					
						
							|  |  |  |       expect(new Response(new ResponseOptions({status: 300})).ok).toEqual(false); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | } |