var assert = require('assert');
var route = require('../../src/js/route');

namedRoutes = JSON.parse('{"home":{"uri":"\/","methods":["GET","HEAD"],"domain":null},"test":{"uri":"user\/{id}","methods":["GET","HEAD"],"domain":"{account}.myapp.com"},"posts.index":{"uri":"posts","methods":["GET","HEAD"],"domain":null},"posts.show":{"uri":"posts\/{id}\/test\/{test}","methods":["GET","HEAD"],"domain":null},"posts.update":{"uri":"posts\/{id}","methods":["PUT"],"domain":null},"posts.store":{"uri":"posts","methods":["POST"],"domain":null},"posts.destroy":{"uri":"posts\/{id}","methods":["DELETE"],"domain":null}}'),
    baseUrl = 'http://myapp.dev/';

describe('route()', function() {
    it('Should return URL when run without params on a route without params', function() {
      assert.equal("http://myapp.dev/posts", route.route('posts.index'));
    });
});
@@ -158,18 +158,28 @@
 ull%7D,%22te
-st
+am.user.show
 %22:%7B%22uri%22
@@ -184,16 +184,17 @@
 i%22:%22user
+s
 %5C/%7Bid%7D%22,
@@ -233,23 +233,20 @@
 %22:%22%7B
-account
+team
 %7D.myapp.
 com%22
@@ -245,11 +245,11 @@
 app.
-com
+dev
 %22%7D,%22
@@ -352,22 +352,8 @@
 %7Bid%7D
-%5C/test%5C/%7Btest%7D
 %22,%22m
@@ -765,16 +765,18 @@
 %7B%0A      
+  
 assert.e
@@ -780,16 +780,29 @@
 t.equal(
+%0A            
 %22http://
@@ -818,16 +818,28 @@
 /posts%22,
+%0A           
  route.r
@@ -857,16 +857,756 @@
 .index')
+%0A        );%0A    %7D);%0A    %0A    it('Should return missing params error when run with missing params on a route with required params', function() %7B%0A        assert.throws(%0A            () =%3E route.route('posts.show'),%0A            /%5C%22id%5C%22 key is required/%0A        );%0A    %7D);%0A%0A    it('Should return URL when run with params on a route with required params', function() %7B%0A        assert.equal(%0A            %22http://myapp.dev/posts/1%22,%0A            route.route('posts.show', %7Bid: 1%7D)%0A        );%0A    %7D);%0A%0A    it('Should return correct URL when run with params on a route with required domain params', function() %7B%0A        assert.equal(%0A            %22tighten.myapp.dev/users/1%22,%0A            route.route('team.user.show', %7Bteam: 'tighten', id: 1%7D)%0A        
 );%0A    %7D

Add mocha tests for basic functions of route().