Use the transport's defer method within the client_action to ensure we use the configured promises everywhere. Allow search requests to be made without any arguments.
This commit is contained in:
13
test/unit/browser_builds/angular.js
vendored
13
test/unit/browser_builds/angular.js
vendored
@ -56,4 +56,17 @@ describe('Angular esFactory', function () {
|
||||
};
|
||||
});
|
||||
});
|
||||
it('returns an error created by calling a method incorrectly', function (done) {
|
||||
directive(function (esFactory) {
|
||||
return function () {
|
||||
var client = esFactory({ hosts: null });
|
||||
client.get().then(function () {
|
||||
expect.fail('promise should have been rejected');
|
||||
}, function (err) {
|
||||
expect(err.message).to.match(/unable/);
|
||||
done();
|
||||
});
|
||||
};
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -20,6 +20,9 @@ function mockClient() {
|
||||
} else {
|
||||
return when.resolve(params);
|
||||
}
|
||||
},
|
||||
defer: function () {
|
||||
return when.defer();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user