Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

Commit

Permalink
Add matching test for doc_insert with params
Browse files Browse the repository at this point in the history
  • Loading branch information
JayBeavers committed Aug 7, 2012
1 parent d84b28f commit 33d0348
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/doc/insert.js
Expand Up @@ -23,6 +23,14 @@ specify("doc_insert:simple", timeout, function (assert) {
});
});

specify("doc_insert:params", timeout, function (assert) {
db.insert({"foo": "baz"}, "foobaz", { new_edits: false }, function (error, foo) {
assert.equal(error, undefined, "Should have stored foo");
assert.equal(foo.ok, true, "Response should be ok");
assert.ok(foo.rev, "Response should have rev");
});
});

specify("doc_insert:functions", timeout, function (assert) {
db.insert({fn: function () { return true; },
fn2: "function () { return true; }"}, function (error, fns) {
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/doc/insert.json
Expand Up @@ -10,6 +10,12 @@
, "body" : "{\"foo\":\"baz\"}"
, "response" : "{\"ok\":true,\"id\":\"foobaz\",\"rev\":\"1-611488\"}"
}
, { "method" : "put"
, "status" : 201
, "path" : "/doc_insert/foobaz?new_edits=false"
, "body" : "{\"foo\":\"baz\"}"
, "response" : "{\"ok\":true,\"id\":\"foobaz\",\"rev\":\"1-611488\"}"
}
, { "method" : "post"
, "status" : 201
, "path" : "/doc_insert"
Expand Down

0 comments on commit 33d0348

Please sign in to comment.