Permalink
Browse files

Test suite includes POST

Fix #9. Fix #10.

Signed-off-by: DTrejo <david.daniel.trejo@gmail.com>
  • Loading branch information...
1 parent de11298 commit 27714deedbe78b3c4ab5665681b121a9aee239ae Joakim committed with DTrejo Oct 4, 2012
Showing with 23 additions and 0 deletions.
  1. +23 −0 test.js
View
23 test.js
@@ -134,4 +134,27 @@ specify("append", function (assert) {
});
});
+specify("post", function (assert) {
+
+ var bucket = "bucket_1",
+ url = "/riak/" + bucket
+ options = {},
+ value = "value " + Math.random();
+
+ client.post(url, JSON.stringify(value), function(err, res, obj) {
+ assert.ok(!err);
+ assert.ok(res.headers.location !== null);
+ assert.equal(res.statusCode, 201);
+
+ var uri = res.headers.location.split("/"),
+ id = uri[uri.length - 1];
+
+ client.get(bucket, id, options, function(err, res, obj2) {
+ assert.ok(!err);
+ assert.equal(res.statusCode, 200);
+ assert.equal(obj2, value);
+ });
+ });
+});
+
specify.run(filters);

0 comments on commit 27714de

Please sign in to comment.