{"size": 3745, "ext": "js", "max_stars_repo_path": "test/fixtures/controller-tests.js", "max_stars_repo_name": "shaunpersad/scenic-route", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/fixtures/controller-tests.js", "max_issues_repo_name": "shaunpersad/scenic-route", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/fixtures/controller-tests.js", "max_forks_repo_name": "shaunpersad/scenic-route", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.3040540541, "max_line_length": 82, "alphanum_fraction": 0.4397863818}
"use strict";
var fs = require('fs');
var path = require('path');
var http = require('http');
var request = require('supertest');
var should = require('should');

module.exports = function(requestHandler) {


    it('should route to controller route 1', function(done) {

        request(requestHandler)
            .get('/controller-route-1/greeting')
            .expect(200)
            .end(function(err, res){

                if (err) {
                    throw err;
                }
                res.text.should.equal('hi');
                done();
            });
    });

    it('should route to controller route 2', function(done) {

        request(requestHandler)
            .get('/controller-route-2/greeting')
            .expect(200)
            .end(function(err, res){

                if (err) {
                    throw err;
                }
                res.text.should.equal('/controller-route-2/greeting?addition=yo');
                done();
            });
    });

    it('should route to controller route 3', function(done) {

        request(requestHandler)
            .get('/controller-route-3/greeting')
            .expect(200)
            .end(function(err, res){

                if (err) {
                    throw err;
                }
                res.text.should.equal('sup');
                done();
            });
    });

    it('should route to controller route 4', function(done) {

        request(requestHandler)
            .get('/controller-route-4/greeting')
            .expect(200)
            .end(function(err, res){

                if (err) {
                    throw err;
                }
                res.text.should.equal('howdy');
                done();
            });
    });

    it('should route to controller [get] route 5', function(done) {

        request(requestHandler)
            .get('/controller-group/controller-route-5/greeting')
            .expect(200)
            .end(function(err, res){

                if (err) {
                    throw err;
                }
                res.text.should.equal('hola');
                done();
            });
    });

    it('should route to controller [post] route 5', function(done) {

        request(requestHandler)
            .post('/controller-group/controller-route-5/another-greeting')
            .expect(200)
            .end(function(err, res){

                if (err) {
                    throw err;
                }
                res.text.should.equal('aloha');
                done();
            });
    });

    it('should route to controller route 6', function(done) {

        request(requestHandler)
            .post('/controller-group/controller-route-6')
            .expect(200)
            .end(function(err, res){

                if (err) {
                    throw err;
                }
                res.text.should.equal('bro');
                done();
            });
    });


    it('should route to controller route 7', function(done) {

        request(requestHandler)
            .get('/controller-route-7/namaste/greeting')
            .expect(200)
            .end(function(err, res){

                if (err) {
                    throw err;
                }
                res.text.should.equal('namaste');
                done();
            });
    });

    it('should route to controller route 8', function(done) {

        request(requestHandler)
            .get('/controller-route-8/greeting/namaste')
            .expect(200)
            .end(function(err, res){

                if (err) {
                    throw err;
                }
                res.text.should.equal('namaste');
                done();
            });
    });

};
