| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  | import { | 
					
						
							|  |  |  |   AsyncTestCompleter, | 
					
						
							|  |  |  |   beforeEach, | 
					
						
							|  |  |  |   ddescribe, | 
					
						
							|  |  |  |   describe, | 
					
						
							|  |  |  |   expect, | 
					
						
							|  |  |  |   iit, | 
					
						
							|  |  |  |   inject, | 
					
						
							|  |  |  |   it, | 
					
						
							|  |  |  |   xit | 
					
						
							|  |  |  | } from 'angular2/test_lib'; | 
					
						
							| 
									
										
										
										
											2015-06-24 00:27:07 -07:00
										 |  |  | import {BaseRequestOptions, RequestOptions} from 'angular2/src/http/base_request_options'; | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  | import {RequestMethods, RequestModesOpts} from 'angular2/src/http/enums'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export function main() { | 
					
						
							|  |  |  |   describe('BaseRequestOptions', () => { | 
					
						
							|  |  |  |     it('should create a new object when calling merge', () => { | 
					
						
							|  |  |  |       var options1 = new BaseRequestOptions(); | 
					
						
							| 
									
										
										
										
											2015-06-24 00:27:07 -07:00
										 |  |  |       var options2 = options1.merge(new RequestOptions({method: RequestMethods.DELETE})); | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  |       expect(options2).not.toBe(options1); | 
					
						
							|  |  |  |       expect(options2.method).toBe(RequestMethods.DELETE); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should retain previously merged values when merging again', () => { | 
					
						
							|  |  |  |       var options1 = new BaseRequestOptions(); | 
					
						
							| 
									
										
										
										
											2015-06-24 00:27:07 -07:00
										 |  |  |       var options2 = options1.merge(new RequestOptions({method: RequestMethods.DELETE})); | 
					
						
							|  |  |  |       var options3 = options2.merge(new RequestOptions({mode: RequestModesOpts.NoCors})); | 
					
						
							| 
									
										
										
										
											2015-06-13 15:49:05 -07:00
										 |  |  |       expect(options3.mode).toBe(RequestModesOpts.NoCors); | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  |       expect(options3.method).toBe(RequestMethods.DELETE); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | } |