<commit_before># basic.coffee

http = require 'http'
request = require 'request'
should = require 'should'
nock   = require 'nock'
sinon  = require 'sinon'

mongoose = require 'mongoose'
server = require 'serv'
User = require 'models/user'
Box = require 'models/box'

httpopts = {host:'127.0.0.1', port:3000, path:'/'}
baseurl = 'http://127.0.0.1:3000/'

APIKEY = '342709d1-45b0-2d2e-sd66-6fb81d10e34e'
BOX = 'olddatabox'

describe 'Box documentation', ->
  describe '( GET / )', ->

    it 'documents how to create a box', (done) ->
      u = baseurl
      request.get {url:u}, (err, resp, body) ->
        resp.statusCode.should.equal 200
        resp.body.should.include 'reate'
        resp.body.should.include 'API'
        resp.body.should.include 'curl'
        done()

  describe '( GET /<box_name> )', ->

    before (done) ->
      User.collection.drop()
      Box.collection.drop()

      new User({apikey: APIKEY}).save()
      User.findOne {apikey: APIKEY}, (err, user) ->
        console.log err if err
        new Box({user: user._id, name: BOX}).save()
        done()

    it 'documents how to SSH into a box', (done) ->
      u = baseurl + BOX
      request.get {url:u}, (err, resp, body) ->
        resp.statusCode.should.equal 200
        resp.body.should.include 'ssh'
        resp.body.should.include 'curl'
        resp.body.should.include '@'
        done()
<commit_msg>Make sure documentation is json<commit_after># basic.coffee

http = require 'http'
request = require 'request'
should = require 'should'
nock   = require 'nock'
sinon  = require 'sinon'

mongoose = require 'mongoose'
server = require 'serv'
User = require 'models/user'
Box = require 'models/box'

httpopts = {host:'127.0.0.1', port:3000, path:'/'}
baseurl = 'http://127.0.0.1:3000/'

APIKEY = '342709d1-45b0-2d2e-sd66-6fb81d10e34e'
BOX = 'olddatabox'

describe 'Box documentation', ->
  describe '( GET / )', ->

    it 'documents how to create a box', (done) ->
      u = baseurl
      request.get {url:u}, (err, resp, body) ->
        resp.statusCode.should.equal 200
        resp.body.should.include 'reate'
        resp.body.should.include 'API'
        resp.body.should.include 'curl'
        JSON.parse resp.body
        done()

  describe '( GET /<box_name> )', ->

    before (done) ->
      User.collection.drop()
      Box.collection.drop()

      new User({apikey: APIKEY}).save()
      User.findOne {apikey: APIKEY}, (err, user) ->
        console.log err if err
        new Box({user: user._id, name: BOX}).save()
        done()

    it 'documents how to SSH into a box', (done) ->
      u = baseurl + BOX
      request.get {url:u}, (err, resp, body) ->
        resp.statusCode.should.equal 200
        resp.body.should.include 'ssh'
        resp.body.should.include 'curl'
        resp.body.should.include '@'
        JSON.parse resp.body
        done()

{'fraction_non_alphanumeric': 0.15373864430468204, 'fraction_numerical': 0.03284416491963662, 'mean_word_length': 2.5128834355828222, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '6507930', 'n_tokens_mistral': 1045, 'n_tokens_neox': 972, 'n_words': 244}