Skip to content
Browse files

[reqheaders] moves stuff to shared

  • Loading branch information...
1 parent 53f0e6c commit b3e60a506869f776d0ebd5e9cdf73a6e87341c2f @dscape committed May 29, 2012
Showing with 19 additions and 19 deletions.
  1. +1 −1 package.json
  2. +6 −6 tests/fixtures/{opts → shared}/headers.json
  3. +12 −12 tests/{opts → shared}/headers.js
View
2 package.json
@@ -2,7 +2,7 @@
, "description" : "minimalistic couchdb driver for node.js"
, "homepage" : "http://github.com/dscape/nano"
, "repository" : "git://github.com/dscape/nano"
-, "version" : "3.0.6"
+, "version" : "3.0.7"
, "author" : "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)"
, "contributors" :
[ "Thiago Arrais <thiago.arrais@gmail.com> (http://thiagoarrais.com)"
View
12 tests/fixtures/opts/headers.json → tests/fixtures/shared/headers.json
@@ -1,28 +1,28 @@
[
{ "method" : "put"
- , "path" : "/opts_headers"
+ , "path" : "/shared_headers"
, "status" : 201
, "response" : "{ \"ok\": true }"
}
, { "method" : "put"
- , "path" : "/opts_headers/new/att"
+ , "path" : "/shared_headers/new/att"
, "body" : "\"Hello\""
, "status" : 201
, "response" : "{\"ok\":true,\"id\":\"new\",\"rev\":\"1-5142a2\"}"
}
-, { "path" : "/opts_headers/new/att"
+, { "path" : "/shared_headers/new/att"
, "status" : 304
, "response" : ""
, "reqheaders" : {
- "If-None-Match": "\"1-5142a2e74e1ec33e6e5b621418210283\""
+ "If-None-Match": "\"1-5142a2\""
}
}
-, { "path" : "/opts_headers/new/att"
+, { "path" : "/shared_headers/new/att"
, "status" : 200
, "response" : "\"Hello\""
}
, { "method" : "delete"
- , "path" : "/opts_headers"
+ , "path" : "/shared_headers"
, "status" : 200
, "response" : "{ \"ok\": true }"
}
View
24 tests/opts/headers.js → tests/shared/headers.js
@@ -6,37 +6,37 @@ var specify = require('specify')
, nock = helpers.nock
;
-var mock = nock(helpers.couch, "opts/headers")
- , db = nano.use("opts_headers")
+var mock = nock(helpers.couch, "shared/headers")
+ , db = nano.use("shared_headers")
;
-specify("opts_headers:setup", timeout, function (assert) {
- nano.db.create("opts_headers", function (err) {
+specify("shared_headers:setup", timeout, function (assert) {
+ nano.db.create("shared_headers", function (err) {
assert.equal(err, undefined, "Failed to create database");
});
});
-specify("opts_headers:test", timeout, function (assert) {
+specify("shared_headers:test", timeout, function (assert) {
db.attachment.insert("new", "att", "Hello", "text/plain",
function(error, hello) {
assert.equal(error, undefined, "Should store hello");
assert.equal(hello.ok, true, "Response should be ok");
assert.ok(hello.rev, "Should have a revision number");
nano.request({
- db: "opts_headers",
+ db: "shared_headers",
doc: "new",
att: "att",
- headers: {
- "If-None-Match": "\"1-5142a2e74e1ec33e6e5b621418210283\""
- }
+ // should be JSON.stringify(hello.rev)
+ // this should fail npm test
+ headers: { "If-None-Match": "FooBAR" }
},
function (error, helloWorld, rh) {
assert.equal(error, undefined, "Should get the hello");
assert.equal(rh["status-code"], 304, "status is 'not modified'");
});
nano.request({
- db: "opts_headers",
+ db: "shared_headers",
doc: "new",
att: "att"
},
@@ -47,8 +47,8 @@ specify("opts_headers:test", timeout, function (assert) {
});
});
-specify("opts_headers:teardown", timeout, function (assert) {
- nano.db.destroy("opts_headers", function (err) {
+specify("shared_headers:teardown", timeout, function (assert) {
+ nano.db.destroy("shared_headers", function (err) {
assert.equal(err, undefined, "Failed to destroy database");
assert.ok(mock.isDone(), "Some mocks didn't run");
});

0 comments on commit b3e60a5

Please sign in to comment.
Something went wrong with that request. Please try again.