mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-29 23:52:50 +00:00
23 lines
No EOL
593 B
JavaScript
23 lines
No EOL
593 B
JavaScript
"use strict";
|
|
|
|
var helper = require("./helpers/index.js");
|
|
var Session = helper.Session;
|
|
var assert = require("chai").assert;
|
|
var async = require("async");
|
|
|
|
describe("Session model", function () {
|
|
describe(".create", function () {
|
|
var session;
|
|
beforeEach(function () {
|
|
session = { userId: Math.floor(Math.random() * 10000) };
|
|
});
|
|
it ("creates a new session", function (done) {
|
|
Session.create(session, function (error, result) {
|
|
if (error) return done(error);
|
|
assert.equal(result.userId, session.userId);
|
|
assert.isString(result.key);
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
}); |