{"size": 716, "ext": "js", "max_stars_repo_path": "softwerkskammer/test/middleware/expressSessionConfigurator_test.js", "max_stars_repo_name": "nureineide/Agora", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "softwerkskammer/test/middleware/expressSessionConfigurator_test.js", "max_issues_repo_name": "nureineide/Agora", "max_issues_repo_issues_event_min_datetime": "2015-07-12T17:10:41.000Z", "max_issues_repo_issues_event_max_datetime": "2015-07-12T17:14:38.000Z", "max_forks_repo_path": "softwerkskammer/test/middleware/expressSessionConfigurator_test.js", "max_forks_repo_name": "nureineide/Agora", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 26.5185185185, "max_line_length": 80, "alphanum_fraction": 0.656424581}
'use strict';

var conf = require('../../testutil/configureForTest');
var beans = conf.get('beans');
var expressSessionConfigurator = beans.get('expressSessionConfigurator');
var MemoryStore = require('express-session').MemoryStore;
var expect = require('must');

describe('Configuration sets Persistent Store only if configured', function () {

  it('to RAM Store', function () {
    var req = {
      originalUrl: '/something',
      headers: {},
      cookies: {},
      signedCookies: {}
    };
    var next = function () { return ''; };
    expressSessionConfigurator(req, {}, next);

    expect(conf.get('dontUsePersistentSessions')).to.be(true);
    expect(req.sessionStore).to.be.a(MemoryStore);
  });

});

