2016-04-12 12:40:37 -04:00
|
|
|
import {
|
|
|
|
beforeEach,
|
|
|
|
ddescribe,
|
|
|
|
describe,
|
|
|
|
expect,
|
|
|
|
iit,
|
|
|
|
inject,
|
|
|
|
it,
|
|
|
|
xit
|
2016-04-28 20:50:03 -04:00
|
|
|
} from '@angular/core/testing/testing_internal';
|
|
|
|
import {BaseRequestOptions, RequestOptions} from '../src/base_request_options';
|
|
|
|
import {RequestMethod} from '../src/enums';
|
2015-06-13 00:50:19 -04:00
|
|
|
|
|
|
|
export function main() {
|
|
|
|
describe('BaseRequestOptions', () => {
|
|
|
|
it('should create a new object when calling merge', () => {
|
|
|
|
var options1 = new BaseRequestOptions();
|
2015-12-03 16:44:14 -05:00
|
|
|
var options2 = options1.merge(new RequestOptions({method: RequestMethod.Delete}));
|
2015-06-13 00:50:19 -04:00
|
|
|
expect(options2).not.toBe(options1);
|
2015-12-03 16:44:14 -05:00
|
|
|
expect(options2.method).toBe(RequestMethod.Delete);
|
2015-06-13 00:50:19 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should retain previously merged values when merging again', () => {
|
|
|
|
var options1 = new BaseRequestOptions();
|
2015-12-03 16:44:14 -05:00
|
|
|
var options2 = options1.merge(new RequestOptions({method: RequestMethod.Delete}));
|
|
|
|
expect(options2.method).toBe(RequestMethod.Delete);
|
2015-06-13 00:50:19 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|