Skip to content

Commit

Permalink
chore(ajax.patch): Adds test for ajax.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jayphelps committed Feb 14, 2017
1 parent 46c954a commit 1821519
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/observables/dom/ajax-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,21 @@ describe('Observable.ajax', () => {
delete root.XMLHttpRequest.prototype.onerror;
delete root.XMLHttpRequest.prototype.upload;
});

describe('ajax.patch', () => {
it('should create an AjaxObservable with correct options', () => {
const body = { foo: 'bar' };
const headers = { first: 'first' };
// returns Observable, not AjaxObservable, so needs a cast
const { request } = <any>Rx.Observable
.ajax.patch('/flibbertyJibbet', body, headers);

expect(request.method).to.equal('PATCH');
expect(request.url).to.equal('/flibbertyJibbet');
expect(request.body).to.equal(body);
expect(request.headers).to.equal(headers);
});
});
});

class MockXMLHttpRequest {
Expand Down

0 comments on commit 1821519

Please sign in to comment.