var chai = require('chai');
var expect = chai.expect;

describe('Server', function() {

  describe('Route handlers', function() {
    var handlers = require('../server/handlers.js');

    describe('getRoutes', function() {

      it('should be a function', function() {
        expect(handlers.getRoutes).to.be.a('function');
      });

      /**
       * Add these tests:
       * it should take two strings
       * it should return a promise that contains path data
       * it should query a string properly
       * it should provide all the required props to a ajax req
       * it should throw an error upon ajax failure
       */
       it('should return an object', function() {
        var result = handlers.getRoutes('San Francisco', 'San Jose');
        expect(result).to.be.instanceof(Object);
       });
    });

    describe('submit', function() {

      it('should be a function', function() {
        expect(handlers.getRoutes).to.be.a('function');
      });

      it('should throw an error for empty arguments', function() {
        // fix this test
        expect(false).to.equal(true);
      })
    });

    describe('getRestaurants', function() {
      
      it ('should be a function', function() {
        expect(handlers.getRestaurants).to.be.a('function');
      })
    })

  });

});
@@ -46,16 +46,50 @@
 .expect;
+%0Avar request = require('request');
 %0A%0Adescri
@@ -667,25 +667,24 @@
    */%0A      
- 
 it('should r
@@ -835,25 +835,24 @@
 ect);%0A      
- 
 %7D);%0A    %7D);%0A
@@ -1057,32 +1057,36 @@
 ents', function(
+done
 ) %7B%0A        // f
@@ -1110,46 +1110,157 @@
     
-expect(false).to.equal(true);%0A      %7D)
+request.post('http://127.0.0.1:8000/maps/submit', function (error, response, body) %7B%0A          expect(error);%0A          done();%0A        %7D);%0A      %7D);
 %0A   
@@ -1432,23 +1432,27 @@
       %7D)
+;%0A%0A
 %0A    %7D)
+;
 %0A%0A  %7D);%0A

Write test for serverside submit handler