Comparing version 0.0.8 to 0.0.9
{ | ||
"name": "cube", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "A system for time series visualization using MongoDB, Node and D3.", | ||
@@ -5,0 +5,0 @@ "keywords": ["time series", "visualization"], |
@@ -15,2 +15,9 @@ var vows = require("vows"), | ||
var obj = { type: "test" | ||
, time: (new Date).toISOString() | ||
, data: { foo: "bar" } | ||
}; | ||
var arr = [obj]; | ||
var num = 42; | ||
server.register = cube.collector.register; | ||
@@ -30,2 +37,32 @@ | ||
suite.addBatch(test.batch({ | ||
"POST /event/put with a JSON object": { | ||
topic: test.request({method: "POST", port: port, path: "/1.0/event/put"}, JSON.stringify(obj)), | ||
"responds with status 400": function(response) { | ||
assert.equal(response.statusCode, 400); | ||
assert.deepEqual(JSON.parse(response.body), {status: 400}); | ||
} | ||
} | ||
})); | ||
suite.addBatch(test.batch({ | ||
"POST /event/put with a JSON array": { | ||
topic: test.request({method: "POST", port: port, path: "/1.0/event/put"}, JSON.stringify(arr)), | ||
"responds with status 200": function(response) { | ||
assert.equal(response.statusCode, 200); | ||
assert.deepEqual(JSON.parse(response.body), {status: 200}); | ||
} | ||
} | ||
})); | ||
suite.addBatch(test.batch({ | ||
"POST /event/put with a JSON number": { | ||
topic: test.request({method: "POST", port: port, path: "/1.0/event/put"}, JSON.stringify(num)), | ||
"responds with status 400": function(response) { | ||
assert.equal(response.statusCode, 400); | ||
assert.deepEqual(JSON.parse(response.body), {status: 400}); | ||
} | ||
} | ||
})); | ||
suite.export(module); |
@@ -70,3 +70,3 @@ var mongodb = require("mongodb"), | ||
if (arguments.length > 1) request.write(data); | ||
if (data && data.length > 0) request.write(data); | ||
request.end(); | ||
@@ -73,0 +73,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
671942
9722