mirror of
https://github.com/tenrok/axios.git
synced 2026-06-08 17:22:34 +03:00
Merge pull request #121 from azendoo/custom-encode-params-method
Add support third-party library to serialize url params
This commit is contained in:
@@ -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);
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user