<commit_before>var request = require('supertest');
var requestModule = require('request');
var expect = require('chai').expect;

require('./setup.js');
var db = require('./../../server/config/db');
var appUrl = process.env.PROTOCOL + process.env.HOST + ':' + process.env.PORT;

request = request(appUrl);

describe('Express Server', function() {

  describe('Basic GET request', function() {
    it('returns 302 statusCode for redirection', function(done) {
      request.get('/').expect(302)
      .end(function(err) {
        if (err) return done(err);
        done();
      })
    })
  })

  describe('Authentication', function() {
    beforeEach(function() {
      // Logout the user before each authentication test
      request.get('/logout', function(err, res, body) {});
    });
    describe('Privileged Access', function() {
      it('redirects to welcome page when an unauthenticated user tries to access the main page', function(done) {
        request.get('/')
          .expect(302)
          .expect('Location', '/welcome')
          .end(function(err) {
            if (err) return done(err);
            done();
          });
      });
    });
  })

  // describe 'User authentication', ->
  //   describe 'POST /sessions', ->
  //     describe 'success', ->
  //       it 'redirects to the right path', (done) -><commit_msg>Add further testing structure for auth and session API calls<commit_after>var request = require('supertest');
var expect = require('chai').expect;

require('./setup.js');
var db = require('./../../server/config/db');
var appUrl = process.env.PROTOCOL + process.env.HOST + ':' + process.env.PORT;

request = request(appUrl);

describe('Express Server', function() {

  describe('Basic GET request', function() {
    it('returns 302 statusCode for redirection', function(done) {
      request.get('/').expect(302)
      .end(function(err) {
        if (err) return done(err);
        done();
      })
    })
  })

  describe('Authentication', function() {
    beforeEach(function() {
      // Logout the user before each authentication test
      request.get('/logout', function(err, res, body) {});
    });
    describe('Privileged Access', function() {
      it('redirects to welcome page when an unauthenticated user tries to access the main page', function(done) {
        request.get('/')
          .expect(302)
          .expect('Location', '/welcome')
          .end(function(err) {
            if (err) return done(err);
            done();
          });
      });
    });

    describe('User signup and login', function() {
      it('Signup a new user', function(done) {
        done();
      });
      it('Login with the same username and password combination', function(done) {
        done();
      });
    });

  });

  describe('Saving sessions', function() {

  });

  describe('Saving snapshots', function() {

  });




  // describe 'User authentication', ->
  //   describe 'POST /sessions', ->
  //     describe 'success', ->
  //       it 'redirects to the right path', (done) ->
{'fraction_non_alphanumeric': 0.1681474169134584, 'fraction_numerical': 0.005923000987166831, 'mean_word_length': 2.6018957345971563, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7359681', 'n_tokens_mistral': 874, 'n_tokens_neox': 842, 'n_words': 227}