ensl_gathers/spec/session.js

23 lines
593 B
JavaScript
Raw Permalink Normal View History

2015-08-18 09:56:35 +00:00
"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();
});
});
});
});