| 
									
										
										
										
											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
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-27 17:12:25 -07:00
										 |  |  | import {describe, expect, it} from '@angular/core/testing/testing_internal'; | 
					
						
							| 
									
										
										
										
											2016-04-28 17:50:03 -07:00
										 |  |  | import {BaseRequestOptions, RequestOptions} from '../src/base_request_options'; | 
					
						
							|  |  |  | import {RequestMethod} from '../src/enums'; | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | export function main() { | 
					
						
							|  |  |  |   describe('BaseRequestOptions', () => { | 
					
						
							|  |  |  |     it('should create a new object when calling merge', () => { | 
					
						
							| 
									
										
										
										
											2016-11-12 14:08:58 +01:00
										 |  |  |       const options1 = new BaseRequestOptions(); | 
					
						
							|  |  |  |       const options2 = options1.merge(new RequestOptions({method: RequestMethod.Delete})); | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  |       expect(options2).not.toBe(options1); | 
					
						
							| 
									
										
										
										
											2015-12-03 22:44:14 +01:00
										 |  |  |       expect(options2.method).toBe(RequestMethod.Delete); | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should retain previously merged values when merging again', () => { | 
					
						
							| 
									
										
										
										
											2016-11-12 14:08:58 +01:00
										 |  |  |       const options1 = new BaseRequestOptions(); | 
					
						
							|  |  |  |       const options2 = options1.merge(new RequestOptions({method: RequestMethod.Delete})); | 
					
						
							| 
									
										
										
										
											2015-12-03 22:44:14 +01:00
										 |  |  |       expect(options2.method).toBe(RequestMethod.Delete); | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | } |