-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
40 lines (32 loc) · 937 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var connect = require('connect');
var should = require('should');
var mongoose = require('mongoose');
var mc = require('./index.js')(connect);
var m, ms;
before(function() {
m = mongoose.model("Session");
m.update = function(query, data, options, cb) {
cb(null, arguments);
}
ms = new mc();
});
describe("test connect mongoose require", function() {
it("should create model for Session schema", function( /*done*/ ) {
m.modelName.should.equal("Session");
});
});
describe("test set", function() {
it("should calls session update with proper object", function( /*done*/ ) {
ms.set("abc", {"test":"sweet"},function(err, data){
data[1].should.eql({ sid: 'abc', data: '{"test":"sweet"}', expires: null });
});
});
});
describe("test get", function() {
it("should ----", function( /*done*/ ) {
});
});
describe("test destroy", function() {
it("should ----", function( /*done*/ ) {
});
});