mirror of
https://github.com/tenrok/axios.git
synced 2026-05-30 15:24:11 +03:00
Fixing failing tests
This commit is contained in:
@@ -30,10 +30,7 @@ describe('wrapper', function () {
|
||||
axios({
|
||||
method: 'post',
|
||||
url: '/foo',
|
||||
data: {
|
||||
firstName: 'foo',
|
||||
lastName: 'bar'
|
||||
}
|
||||
data: 'fizz=buzz'
|
||||
});
|
||||
|
||||
var request = jasmine.Ajax.requests.mostRecent();
|
||||
@@ -45,6 +42,20 @@ describe('wrapper', function () {
|
||||
}
|
||||
});
|
||||
|
||||
it('should use application/json when posting an object', function () {
|
||||
axios({
|
||||
url: '/foo/bar',
|
||||
method: 'post',
|
||||
data: {
|
||||
firstName: 'foo',
|
||||
lastName: 'bar'
|
||||
}
|
||||
});
|
||||
|
||||
var request = jasmine.Ajax.requests.mostRecent();
|
||||
expect(request.requestHeaders['Content-Type']).toEqual('application/json;charset=utf-8');
|
||||
});
|
||||
|
||||
it('should support binary data as array buffer', function () {
|
||||
var input = new Int8Array(2);
|
||||
input[0] = 1;
|
||||
|
||||
@@ -19,6 +19,12 @@ module.exports = {
|
||||
test.done();
|
||||
},
|
||||
|
||||
testIsUndefined: function (test) {
|
||||
test.equals(utils.isUndefined(), true);
|
||||
test.equals(utils.isUndefined(null), false);
|
||||
test.done();
|
||||
},
|
||||
|
||||
testIsObject: function (test) {
|
||||
test.equals(utils.isObject({}), true);
|
||||
test.equals(utils.isObject(null), false);
|
||||
|
||||
Reference in New Issue
Block a user