{"action":"created","comment":{"url":"https://api.github.com/repos/Daniel15/RouteJs/pulls/comments/47468133","id":47468133,"diff_hunk":"@@ -50,5 +50,42 @@ public void GetsRoutesFromRouteFetcher()\n \t\t\tconst string expected = @\"{\"\"routes\"\":[{\"\"url\"\":\"\"foo/bar\"\",\"\"defaults\"\":{\"\"controller\"\":\"\"Foo\"\",\"\"action\"\":\"\"Bar\"\"},\"\"constraints\"\":{\"\"constr\"\":\"\"aint\"\"},\"\"optional\"\":[\"\"id\"\"]}],\"\"baseUrl\"\":\"\"/base\"\",\"\"lowerCaseUrls\"\":false}\";\n \t\t\tAssert.Equal(expected, result);\n \t\t}\n+\n+\t\t[Fact]\n+\t\tpublic void InsertsSlashAtTheBeginningOfBaseUrl()\n+\t\t{\n+\t\t\tvar routes = new[]\n+\t\t\t\t{\n+\t\t\t\tnew RouteInfo\n+\t\t\t\t{\n+\t\t\t\t\tConstraints = new Dictionary<string, object> {{\"constr\", \"aint\"}},\n+\t\t\t\t\tDefaults = new Dictionary<string, object>\n+\t\t\t\t\t{\n+\t\t\t\t\t\t{\"controller\", \"Foo\"},\n+\t\t\t\t\t\t{\"action\", \"Bar\"}\n+\t\t\t\t\t},\n+\t\t\t\t\tOptional = new[] {\"id\"},\n+\t\t\t\t\tUrl = \"foo/bar\",\n+\t\t\t\t},\n+\t\t\t};\n+\t\t\tvar routeFetcher = new Mock<IRouteFetcher>();\n+\t\t\trouteFetcher.Setup(x => x.GetRoutes(It.IsAny<RouteData>())).Returns(routes);\n+\n+\t\t\tvar request = new Mock<HttpRequest>();\n+\t\t\trequest.Setup(x => x.PathBase).Returns(new PathString(\"\"));\n+\t\t\tvar httpContext = new Mock<HttpContext>();\n+\t\t\thttpContext.Setup(x => x.Request).Returns(request.Object);\n+\t\t\tvar actionContext = new Mock<IActionContextAccessor>();\n+\t\t\tactionContext.Setup(x => x.ActionContext).Returns(new ActionContext\n+\t\t\t{\n+\t\t\t\tHttpContext = httpContext.Object\n+\t\t\t});\n+\t\t\tvar config = new Mock<IRouteJsConfiguration>();\n+\n+\t\t\tvar routeJs = new RouteJs(new[] { routeFetcher.Object }, actionContext.Object, Enumerable.Empty<IRouteFilter>(), config.Object);\n+\t\t\tvar result = routeJs.GetJsonData();\n+\t\t\tconst string expected = @\"{\"\"routes\"\":[{\"\"url\"\":\"\"foo/bar\"\",\"\"defaults\"\":{\"\"controller\"\":\"\"Foo\"\",\"\"action\"\":\"\"Bar\"\"},\"\"constraints\"\":{\"\"constr\"\":\"\"aint\"\"},\"\"optional\"\":[\"\"id\"\"]}],\"\"baseUrl\"\":\"\"/\"\",\"\"lowerCaseUrls\"\":false}\";","path":"src/RouteJs.Tests.AspNet/RouteJsTests.cs","position":38,"original_position":38,"commit_id":"c8a74ef0926b8b1c6ffd1d380ac5defeb9cf1a4b","original_commit_id":"c8a74ef0926b8b1c6ffd1d380ac5defeb9cf1a4b","user":{"login":"mrahhal","id":4404199,"avatar_url":"https://avatars.githubusercontent.com/u/4404199?v=3","gravatar_id":"","url":"https://api.github.com/users/mrahhal","html_url":"https://github.com/mrahhal","followers_url":"https://api.github.com/users/mrahhal/followers","following_url":"https://api.github.com/users/mrahhal/following{/other_user}","gists_url":"https://api.github.com/users/mrahhal/gists{/gist_id}","starred_url":"https://api.github.com/users/mrahhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrahhal/subscriptions","organizations_url":"https://api.github.com/users/mrahhal/orgs","repos_url":"https://api.github.com/users/mrahhal/repos","events_url":"https://api.github.com/users/mrahhal/events{/privacy}","received_events_url":"https://api.github.com/users/mrahhal/received_events","type":"User","site_admin":false},"body":"Sure, you mean deserialize the result into perhaps an ExpandoObject and check just for the baseUrl?\r\n\r\n```c#\r\nvar json = JsonConvert.DeserializeObject<ExpandoObject>(\r\n    result, new ExpandoObjectConverter());\r\nconst string expected = \"/\";\r\nAssert...\r\n```","created_at":"2015-12-14T07:44:06Z","updated_at":"2015-12-14T07:44:06Z","html_url":"https://github.com/Daniel15/RouteJs/pull/50#discussion_r47468133","pull_request_url":"https://api.github.com/repos/Daniel15/RouteJs/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/Daniel15/RouteJs/pulls/comments/47468133"},"html":{"href":"https://github.com/Daniel15/RouteJs/pull/50#discussion_r47468133"},"pull_request":{"href":"https://api.github.com/repos/Daniel15/RouteJs/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/Daniel15/RouteJs/pulls/50","id":53529018,"html_url":"https://github.com/Daniel15/RouteJs/pull/50","diff_url":"https://github.com/Daniel15/RouteJs/pull/50.diff","patch_url":"https://github.com/Daniel15/RouteJs/pull/50.patch","issue_url":"https://api.github.com/repos/Daniel15/RouteJs/issues/50","number":50,"state":"open","locked":false,"title":"Use \"/\" by default if the baseUrl is empty","user":{"login":"mrahhal","id":4404199,"avatar_url":"https://avatars.githubusercontent.com/u/4404199?v=3","gravatar_id":"","url":"https://api.github.com/users/mrahhal","html_url":"https://github.com/mrahhal","followers_url":"https://api.github.com/users/mrahhal/followers","following_url":"https://api.github.com/users/mrahhal/following{/other_user}","gists_url":"https://api.github.com/users/mrahhal/gists{/gist_id}","starred_url":"https://api.github.com/users/mrahhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrahhal/subscriptions","organizations_url":"https://api.github.com/users/mrahhal/orgs","repos_url":"https://api.github.com/users/mrahhal/repos","events_url":"https://api.github.com/users/mrahhal/events{/privacy}","received_events_url":"https://api.github.com/users/mrahhal/received_events","type":"User","site_admin":false},"body":"Fixes #49 ","created_at":"2015-12-14T06:32:06Z","updated_at":"2015-12-14T07:44:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"455f2bd85c3606a3ce0156b7e3f95bc1756f1230","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Daniel15/RouteJs/pulls/50/commits","review_comments_url":"https://api.github.com/repos/Daniel15/RouteJs/pulls/50/comments","review_comment_url":"https://api.github.com/repos/Daniel15/RouteJs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Daniel15/RouteJs/issues/50/comments","statuses_url":"https://api.github.com/repos/Daniel15/RouteJs/statuses/c8a74ef0926b8b1c6ffd1d380ac5defeb9cf1a4b","head":{"label":"mrahhal:mrahhal-patch","ref":"mrahhal-patch","sha":"c8a74ef0926b8b1c6ffd1d380ac5defeb9cf1a4b","user":{"login":"mrahhal","id":4404199,"avatar_url":"https://avatars.githubusercontent.com/u/4404199?v=3","gravatar_id":"","url":"https://api.github.com/users/mrahhal","html_url":"https://github.com/mrahhal","followers_url":"https://api.github.com/users/mrahhal/followers","following_url":"https://api.github.com/users/mrahhal/following{/other_user}","gists_url":"https://api.github.com/users/mrahhal/gists{/gist_id}","starred_url":"https://api.github.com/users/mrahhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrahhal/subscriptions","organizations_url":"https://api.github.com/users/mrahhal/orgs","repos_url":"https://api.github.com/users/mrahhal/repos","events_url":"https://api.github.com/users/mrahhal/events{/privacy}","received_events_url":"https://api.github.com/users/mrahhal/received_events","type":"User","site_admin":false},"repo":{"id":43964351,"name":"RouteJs","full_name":"mrahhal/RouteJs","owner":{"login":"mrahhal","id":4404199,"avatar_url":"https://avatars.githubusercontent.com/u/4404199?v=3","gravatar_id":"","url":"https://api.github.com/users/mrahhal","html_url":"https://github.com/mrahhal","followers_url":"https://api.github.com/users/mrahhal/followers","following_url":"https://api.github.com/users/mrahhal/following{/other_user}","gists_url":"https://api.github.com/users/mrahhal/gists{/gist_id}","starred_url":"https://api.github.com/users/mrahhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrahhal/subscriptions","organizations_url":"https://api.github.com/users/mrahhal/orgs","repos_url":"https://api.github.com/users/mrahhal/repos","events_url":"https://api.github.com/users/mrahhal/events{/privacy}","received_events_url":"https://api.github.com/users/mrahhal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrahhal/RouteJs","description":"JavaScript URL routing for ASP.NET MVC and WebForms","fork":true,"url":"https://api.github.com/repos/mrahhal/RouteJs","forks_url":"https://api.github.com/repos/mrahhal/RouteJs/forks","keys_url":"https://api.github.com/repos/mrahhal/RouteJs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrahhal/RouteJs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrahhal/RouteJs/teams","hooks_url":"https://api.github.com/repos/mrahhal/RouteJs/hooks","issue_events_url":"https://api.github.com/repos/mrahhal/RouteJs/issues/events{/number}","events_url":"https://api.github.com/repos/mrahhal/RouteJs/events","assignees_url":"https://api.github.com/repos/mrahhal/RouteJs/assignees{/user}","branches_url":"https://api.github.com/repos/mrahhal/RouteJs/branches{/branch}","tags_url":"https://api.github.com/repos/mrahhal/RouteJs/tags","blobs_url":"https://api.github.com/repos/mrahhal/RouteJs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrahhal/RouteJs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrahhal/RouteJs/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrahhal/RouteJs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrahhal/RouteJs/statuses/{sha}","languages_url":"https://api.github.com/repos/mrahhal/RouteJs/languages","stargazers_url":"https://api.github.com/repos/mrahhal/RouteJs/stargazers","contributors_url":"https://api.github.com/repos/mrahhal/RouteJs/contributors","subscribers_url":"https://api.github.com/repos/mrahhal/RouteJs/subscribers","subscription_url":"https://api.github.com/repos/mrahhal/RouteJs/subscription","commits_url":"https://api.github.com/repos/mrahhal/RouteJs/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrahhal/RouteJs/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrahhal/RouteJs/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrahhal/RouteJs/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrahhal/RouteJs/contents/{+path}","compare_url":"https://api.github.com/repos/mrahhal/RouteJs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrahhal/RouteJs/merges","archive_url":"https://api.github.com/repos/mrahhal/RouteJs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrahhal/RouteJs/downloads","issues_url":"https://api.github.com/repos/mrahhal/RouteJs/issues{/number}","pulls_url":"https://api.github.com/repos/mrahhal/RouteJs/pulls{/number}","milestones_url":"https://api.github.com/repos/mrahhal/RouteJs/milestones{/number}","notifications_url":"https://api.github.com/repos/mrahhal/RouteJs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrahhal/RouteJs/labels{/name}","releases_url":"https://api.github.com/repos/mrahhal/RouteJs/releases{/id}","created_at":"2015-10-09T15:31:45Z","updated_at":"2015-10-09T15:31:46Z","pushed_at":"2015-12-14T06:24:28Z","git_url":"git://github.com/mrahhal/RouteJs.git","ssh_url":"git@github.com:mrahhal/RouteJs.git","clone_url":"https://github.com/mrahhal/RouteJs.git","svn_url":"https://github.com/mrahhal/RouteJs","homepage":null,"size":1811,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Daniel15:master","ref":"master","sha":"4e90b9a2fe91d73b8e0537c969afeebfb81f7a3d","user":{"login":"Daniel15","id":91933,"avatar_url":"https://avatars.githubusercontent.com/u/91933?v=3","gravatar_id":"","url":"https://api.github.com/users/Daniel15","html_url":"https://github.com/Daniel15","followers_url":"https://api.github.com/users/Daniel15/followers","following_url":"https://api.github.com/users/Daniel15/following{/other_user}","gists_url":"https://api.github.com/users/Daniel15/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniel15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniel15/subscriptions","organizations_url":"https://api.github.com/users/Daniel15/orgs","repos_url":"https://api.github.com/users/Daniel15/repos","events_url":"https://api.github.com/users/Daniel15/events{/privacy}","received_events_url":"https://api.github.com/users/Daniel15/received_events","type":"User","site_admin":false},"repo":{"id":10142516,"name":"RouteJs","full_name":"Daniel15/RouteJs","owner":{"login":"Daniel15","id":91933,"avatar_url":"https://avatars.githubusercontent.com/u/91933?v=3","gravatar_id":"","url":"https://api.github.com/users/Daniel15","html_url":"https://github.com/Daniel15","followers_url":"https://api.github.com/users/Daniel15/followers","following_url":"https://api.github.com/users/Daniel15/following{/other_user}","gists_url":"https://api.github.com/users/Daniel15/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniel15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniel15/subscriptions","organizations_url":"https://api.github.com/users/Daniel15/orgs","repos_url":"https://api.github.com/users/Daniel15/repos","events_url":"https://api.github.com/users/Daniel15/events{/privacy}","received_events_url":"https://api.github.com/users/Daniel15/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Daniel15/RouteJs","description":"JavaScript URL routing for ASP.NET MVC and WebForms","fork":false,"url":"https://api.github.com/repos/Daniel15/RouteJs","forks_url":"https://api.github.com/repos/Daniel15/RouteJs/forks","keys_url":"https://api.github.com/repos/Daniel15/RouteJs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Daniel15/RouteJs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Daniel15/RouteJs/teams","hooks_url":"https://api.github.com/repos/Daniel15/RouteJs/hooks","issue_events_url":"https://api.github.com/repos/Daniel15/RouteJs/issues/events{/number}","events_url":"https://api.github.com/repos/Daniel15/RouteJs/events","assignees_url":"https://api.github.com/repos/Daniel15/RouteJs/assignees{/user}","branches_url":"https://api.github.com/repos/Daniel15/RouteJs/branches{/branch}","tags_url":"https://api.github.com/repos/Daniel15/RouteJs/tags","blobs_url":"https://api.github.com/repos/Daniel15/RouteJs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Daniel15/RouteJs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Daniel15/RouteJs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Daniel15/RouteJs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Daniel15/RouteJs/statuses/{sha}","languages_url":"https://api.github.com/repos/Daniel15/RouteJs/languages","stargazers_url":"https://api.github.com/repos/Daniel15/RouteJs/stargazers","contributors_url":"https://api.github.com/repos/Daniel15/RouteJs/contributors","subscribers_url":"https://api.github.com/repos/Daniel15/RouteJs/subscribers","subscription_url":"https://api.github.com/repos/Daniel15/RouteJs/subscription","commits_url":"https://api.github.com/repos/Daniel15/RouteJs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Daniel15/RouteJs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Daniel15/RouteJs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Daniel15/RouteJs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Daniel15/RouteJs/contents/{+path}","compare_url":"https://api.github.com/repos/Daniel15/RouteJs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Daniel15/RouteJs/merges","archive_url":"https://api.github.com/repos/Daniel15/RouteJs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Daniel15/RouteJs/downloads","issues_url":"https://api.github.com/repos/Daniel15/RouteJs/issues{/number}","pulls_url":"https://api.github.com/repos/Daniel15/RouteJs/pulls{/number}","milestones_url":"https://api.github.com/repos/Daniel15/RouteJs/milestones{/number}","notifications_url":"https://api.github.com/repos/Daniel15/RouteJs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Daniel15/RouteJs/labels{/name}","releases_url":"https://api.github.com/repos/Daniel15/RouteJs/releases{/id}","created_at":"2013-05-18T14:40:44Z","updated_at":"2015-11-23T07:22:15Z","pushed_at":"2015-12-14T06:32:07Z","git_url":"git://github.com/Daniel15/RouteJs.git","ssh_url":"git@github.com:Daniel15/RouteJs.git","clone_url":"https://github.com/Daniel15/RouteJs.git","svn_url":"https://github.com/Daniel15/RouteJs","homepage":null,"size":1811,"stargazers_count":42,"watchers_count":42,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":7,"forks":11,"open_issues":7,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Daniel15/RouteJs/pulls/50"},"html":{"href":"https://github.com/Daniel15/RouteJs/pull/50"},"issue":{"href":"https://api.github.com/repos/Daniel15/RouteJs/issues/50"},"comments":{"href":"https://api.github.com/repos/Daniel15/RouteJs/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/Daniel15/RouteJs/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/Daniel15/RouteJs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Daniel15/RouteJs/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/Daniel15/RouteJs/statuses/c8a74ef0926b8b1c6ffd1d380ac5defeb9cf1a4b"}}}}