2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

Add support third-party library to serialize url params

This commit is contained in:
David Fournier
2015-10-03 11:24:49 +02:00
parent 4f732e8caa
commit 14ede9e18e
7 changed files with 52 additions and 27 deletions
+9
View File
@@ -52,5 +52,14 @@ describe('helpers::buildUrl', function () {
length: 5
})).toEqual('/foo?query=bar&start=0&length=5');
});
it('should use serializer if provided', function () {
serializer = sinon.stub();
params = {foo: 'bar'};
serializer.returns('foo=bar');
expect(buildUrl('/foo', params, serializer)).toEqual('/foo?foo=bar');
expect(serializer.calledOnce).toBe(true);
expect(serializer.calledWith(params)).toBe(true);
})
});