2
0
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:
mzabriskie
2014-09-22 10:47:41 -06:00
parent 77bed7c8ab
commit f406b092fc
5 changed files with 34 additions and 5 deletions
+15 -4
View File
@@ -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;
+6
View File
@@ -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);