diff --git a/src/kuzzleDocument.js b/src/kuzzleDocument.js index 175b6c52e..48e11a061 100644 --- a/src/kuzzleDocument.js +++ b/src/kuzzleDocument.js @@ -237,8 +237,15 @@ KuzzleDocument.prototype.refresh = function (options, cb) { KuzzleDocument.prototype.save = function (options, cb) { var data = this.toJSON(), - self = this; - var queryCB = function (error, result) { + self = this, + queryCB; + + if (options && cb === undefined && typeof options === 'function') { + cb = options; + options = null; + } + + queryCB = function (error, result) { if (error) { return cb ? cb(error) : false; } diff --git a/tests/README.md b/tests/README.md index 725e320a5..a277dbc41 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,10 +1,10 @@ Test are done on examples directories. -You must overrid the current Kuzzle instance for all the examples (http://localhost:7512 is used) +You must override the current Kuzzle instance for all the examples (http://localhost:7512 is used) You must launch java -jar selenium-server-standalone-2.46.0.jar You must launch -mocha test/testWebdriverIO.js \ No newline at end of file +mocha test/testWebdriverIO.js