Files
angular-docs-cn/modules/@angular/http/test/base_request_options_spec.ts
T

21 lines
905 B
TypeScript
Raw Normal View History

2016-06-08 16:38:52 -07:00
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
import {BaseRequestOptions, RequestOptions} from '../src/base_request_options';
import {RequestMethod} from '../src/enums';
export function main() {
describe('BaseRequestOptions', () => {
it('should create a new object when calling merge', () => {
var options1 = new BaseRequestOptions();
2015-12-03 22:44:14 +01:00
var options2 = options1.merge(new RequestOptions({method: RequestMethod.Delete}));
expect(options2).not.toBe(options1);
2015-12-03 22:44:14 +01:00
expect(options2.method).toBe(RequestMethod.Delete);
});
it('should retain previously merged values when merging again', () => {
var options1 = new BaseRequestOptions();
2015-12-03 22:44:14 +01:00
var options2 = options1.merge(new RequestOptions({method: RequestMethod.Delete}));
expect(options2.method).toBe(RequestMethod.Delete);
});
});
}