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

31 lines
954 B
TypeScript
Raw Normal View History

import {
AsyncTestCompleter,
beforeEach,
ddescribe,
describe,
expect,
iit,
inject,
it,
xit
2015-10-13 00:29:13 -07:00
} from 'angular2/testing_internal';
2015-08-20 14:28:25 -07:00
import {BaseRequestOptions, RequestOptions} from 'angular2/src/http/base_request_options';
2015-12-03 22:44:14 +01:00
import {RequestMethod} from 'angular2/src/http/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);
});
});
}