| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  | import { | 
					
						
							|  |  |  |   AsyncTestCompleter, | 
					
						
							|  |  |  |   beforeEach, | 
					
						
							|  |  |  |   ddescribe, | 
					
						
							|  |  |  |   describe, | 
					
						
							|  |  |  |   expect, | 
					
						
							|  |  |  |   iit, | 
					
						
							|  |  |  |   inject, | 
					
						
							|  |  |  |   it, | 
					
						
							|  |  |  |   xit | 
					
						
							|  |  |  | } from 'angular2/test_lib'; | 
					
						
							| 
									
										
										
										
											2015-08-20 14:28:25 -07:00
										 |  |  | import {BaseRequestOptions, RequestOptions} from 'angular2/src/http/base_request_options'; | 
					
						
							| 
									
										
										
										
											2015-08-25 10:27:59 +02:00
										 |  |  | import {RequestMethods} from 'angular2/src/http/enums'; | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | export function main() { | 
					
						
							|  |  |  |   describe('BaseRequestOptions', () => { | 
					
						
							|  |  |  |     it('should create a new object when calling merge', () => { | 
					
						
							|  |  |  |       var options1 = new BaseRequestOptions(); | 
					
						
							| 
									
										
										
										
											2015-08-26 13:40:12 -07:00
										 |  |  |       var options2 = options1.merge(new RequestOptions({method: RequestMethods.Delete})); | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  |       expect(options2).not.toBe(options1); | 
					
						
							| 
									
										
										
										
											2015-08-26 13:40:12 -07:00
										 |  |  |       expect(options2.method).toBe(RequestMethods.Delete); | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should retain previously merged values when merging again', () => { | 
					
						
							|  |  |  |       var options1 = new BaseRequestOptions(); | 
					
						
							| 
									
										
										
										
											2015-08-26 13:40:12 -07:00
										 |  |  |       var options2 = options1.merge(new RequestOptions({method: RequestMethods.Delete})); | 
					
						
							| 
									
										
										
										
											2015-08-25 10:27:59 +02:00
										 |  |  |       expect(options2.method).toBe(RequestMethods.Delete); | 
					
						
							| 
									
										
										
										
											2015-06-12 21:50:19 -07:00
										 |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | } |