{"action":"created","comment":{"url":"https://api.github.com/repos/swipely/aviator/pulls/comments/29817893","id":29817893,"diff_hunk":"@@ -13,13 +13,73 @@ describe('Route', function () {\n   });\n \n   describe('given a uri that doesnt match any routes', function () {\n+    var notFoundTarget;\n+\n     beforeEach(function () {\n-      uri = '/fartblaherty';\n-      subject = navigator.createRouteForURI(uri);\n+      notFoundTarget = {\n+        before: function() {},\n+        test: function() {},\n+        notFound1: function () {},\n+        notFound2: function () {},\n+        notFound3: function () {}\n+      };\n+      navigator._routes = {\n+        target: notFoundTarget,\n+        '/fart': {\n+          '/*': 'before',\n+          '/blaherty': {\n+            '/test': 'test',\n+            $notFound: 'notFound1'\n+          },\n+          $notFound: 'notFound2'\n+        },\n+        '/hom': {\n+          '/tulihan': {\n+            '/': 'test'\n+          },\n+          $notFound: 'notFound3'\n+        }\n+      };\n     });\n \n-    it('doesnt return anything', function () {\n-      expect( subject.matchedRoute ).toBe( '' );\n+    describe('when there is no $notFound matcher in the current scope', function () {\n+      describe('and there is no $notFound matcher in a parent scope', function () {\n+        beforeEach(function () {\n+          uri = '/bad/route';\n+          subject = navigator.createRouteForURI(uri);\n+        });\n+\n+        it('doesnt return anything', function () {\n+          expect( subject.actions ).toEqual( [] );\n+        });\n+      });\n+\n+      describe('and there is a $notFound matcher in a parent scope', function () {\n+        beforeEach(function () {\n+          uri = '/hom/hulihan';\n+          subject = navigator.createRouteForURI(uri);\n+        });\n+\n+        it('returns the nearest $notFound matcher', function () {\n+          expect( subject.actions ).toEqual(\n+            [{ method: 'notFound3', target: notFoundTarget }]\n+          );\n+        });\n+      });\n+    });\n+\n+    describe('when there is a $notFound matcher in the current scope', function () {\n+      beforeEach(function () {\n+        uri = '/fart/blaherty/taste';","path":"spec/route_spec.js","position":65,"original_position":65,"commit_id":"fb23f854b2f6642b8a5453850b98afe746132a58","original_commit_id":"fb23f854b2f6642b8a5453850b98afe746132a58","user":{"login":"barnabyc","id":170735,"avatar_url":"https://avatars.githubusercontent.com/u/170735?v=3","gravatar_id":"","url":"https://api.github.com/users/barnabyc","html_url":"https://github.com/barnabyc","followers_url":"https://api.github.com/users/barnabyc/followers","following_url":"https://api.github.com/users/barnabyc/following{/other_user}","gists_url":"https://api.github.com/users/barnabyc/gists{/gist_id}","starred_url":"https://api.github.com/users/barnabyc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barnabyc/subscriptions","organizations_url":"https://api.github.com/users/barnabyc/orgs","repos_url":"https://api.github.com/users/barnabyc/repos","events_url":"https://api.github.com/users/barnabyc/events{/privacy}","received_events_url":"https://api.github.com/users/barnabyc/received_events","type":"User","site_admin":false},"body":"Ahahaha. Oh @nahiluhmot ","created_at":"2015-05-07T01:15:17Z","updated_at":"2015-05-07T01:15:17Z","html_url":"https://github.com/swipely/aviator/pull/65#discussion_r29817893","pull_request_url":"https://api.github.com/repos/swipely/aviator/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/swipely/aviator/pulls/comments/29817893"},"html":{"href":"https://github.com/swipely/aviator/pull/65#discussion_r29817893"},"pull_request":{"href":"https://api.github.com/repos/swipely/aviator/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/swipely/aviator/pulls/65","id":34848868,"html_url":"https://github.com/swipely/aviator/pull/65","diff_url":"https://github.com/swipely/aviator/pull/65.diff","patch_url":"https://github.com/swipely/aviator/pull/65.patch","issue_url":"https://api.github.com/repos/swipely/aviator/issues/65","number":65,"state":"open","locked":false,"title":"Add a not found matcher","user":{"login":"nahiluhmot","id":1449846,"avatar_url":"https://avatars.githubusercontent.com/u/1449846?v=3","gravatar_id":"","url":"https://api.github.com/users/nahiluhmot","html_url":"https://github.com/nahiluhmot","followers_url":"https://api.github.com/users/nahiluhmot/followers","following_url":"https://api.github.com/users/nahiluhmot/following{/other_user}","gists_url":"https://api.github.com/users/nahiluhmot/gists{/gist_id}","starred_url":"https://api.github.com/users/nahiluhmot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nahiluhmot/subscriptions","organizations_url":"https://api.github.com/users/nahiluhmot/orgs","repos_url":"https://api.github.com/users/nahiluhmot/repos","events_url":"https://api.github.com/users/nahiluhmot/events{/privacy}","received_events_url":"https://api.github.com/users/nahiluhmot/received_events","type":"User","site_admin":false},"body":"@AdamEdgett @hojberg @tlunter @flahertyb @barnabyc @ermanc \r\n\r\nThis pull request adds the ability to call a method when there is no matching route. Only one `$notFound` method will be called per page that cannot be found. For more information, see my changes to the `README`.","created_at":"2015-05-06T19:03:11Z","updated_at":"2015-05-07T01:15:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4759456304a9fc60d6d22d4334cf17149c217ac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/swipely/aviator/pulls/65/commits","review_comments_url":"https://api.github.com/repos/swipely/aviator/pulls/65/comments","review_comment_url":"https://api.github.com/repos/swipely/aviator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swipely/aviator/issues/65/comments","statuses_url":"https://api.github.com/repos/swipely/aviator/statuses/fb23f854b2f6642b8a5453850b98afe746132a58","head":{"label":"swipely:add-a-not-found-matcher","ref":"add-a-not-found-matcher","sha":"fb23f854b2f6642b8a5453850b98afe746132a58","user":{"login":"swipely","id":58479,"avatar_url":"https://avatars.githubusercontent.com/u/58479?v=3","gravatar_id":"","url":"https://api.github.com/users/swipely","html_url":"https://github.com/swipely","followers_url":"https://api.github.com/users/swipely/followers","following_url":"https://api.github.com/users/swipely/following{/other_user}","gists_url":"https://api.github.com/users/swipely/gists{/gist_id}","starred_url":"https://api.github.com/users/swipely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swipely/subscriptions","organizations_url":"https://api.github.com/users/swipely/orgs","repos_url":"https://api.github.com/users/swipely/repos","events_url":"https://api.github.com/users/swipely/events{/privacy}","received_events_url":"https://api.github.com/users/swipely/received_events","type":"Organization","site_admin":false},"repo":{"id":10647349,"name":"aviator","full_name":"swipely/aviator","owner":{"login":"swipely","id":58479,"avatar_url":"https://avatars.githubusercontent.com/u/58479?v=3","gravatar_id":"","url":"https://api.github.com/users/swipely","html_url":"https://github.com/swipely","followers_url":"https://api.github.com/users/swipely/followers","following_url":"https://api.github.com/users/swipely/following{/other_user}","gists_url":"https://api.github.com/users/swipely/gists{/gist_id}","starred_url":"https://api.github.com/users/swipely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swipely/subscriptions","organizations_url":"https://api.github.com/users/swipely/orgs","repos_url":"https://api.github.com/users/swipely/repos","events_url":"https://api.github.com/users/swipely/events{/privacy}","received_events_url":"https://api.github.com/users/swipely/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swipely/aviator","description":"Aviator is a single-page front-end router built for modularity.","fork":false,"url":"https://api.github.com/repos/swipely/aviator","forks_url":"https://api.github.com/repos/swipely/aviator/forks","keys_url":"https://api.github.com/repos/swipely/aviator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swipely/aviator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swipely/aviator/teams","hooks_url":"https://api.github.com/repos/swipely/aviator/hooks","issue_events_url":"https://api.github.com/repos/swipely/aviator/issues/events{/number}","events_url":"https://api.github.com/repos/swipely/aviator/events","assignees_url":"https://api.github.com/repos/swipely/aviator/assignees{/user}","branches_url":"https://api.github.com/repos/swipely/aviator/branches{/branch}","tags_url":"https://api.github.com/repos/swipely/aviator/tags","blobs_url":"https://api.github.com/repos/swipely/aviator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swipely/aviator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swipely/aviator/git/refs{/sha}","trees_url":"https://api.github.com/repos/swipely/aviator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swipely/aviator/statuses/{sha}","languages_url":"https://api.github.com/repos/swipely/aviator/languages","stargazers_url":"https://api.github.com/repos/swipely/aviator/stargazers","contributors_url":"https://api.github.com/repos/swipely/aviator/contributors","subscribers_url":"https://api.github.com/repos/swipely/aviator/subscribers","subscription_url":"https://api.github.com/repos/swipely/aviator/subscription","commits_url":"https://api.github.com/repos/swipely/aviator/commits{/sha}","git_commits_url":"https://api.github.com/repos/swipely/aviator/git/commits{/sha}","comments_url":"https://api.github.com/repos/swipely/aviator/comments{/number}","issue_comment_url":"https://api.github.com/repos/swipely/aviator/issues/comments{/number}","contents_url":"https://api.github.com/repos/swipely/aviator/contents/{+path}","compare_url":"https://api.github.com/repos/swipely/aviator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swipely/aviator/merges","archive_url":"https://api.github.com/repos/swipely/aviator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swipely/aviator/downloads","issues_url":"https://api.github.com/repos/swipely/aviator/issues{/number}","pulls_url":"https://api.github.com/repos/swipely/aviator/pulls{/number}","milestones_url":"https://api.github.com/repos/swipely/aviator/milestones{/number}","notifications_url":"https://api.github.com/repos/swipely/aviator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swipely/aviator/labels{/name}","releases_url":"https://api.github.com/repos/swipely/aviator/releases{/id}","created_at":"2013-06-12T16:53:45Z","updated_at":"2015-04-30T20:56:54Z","pushed_at":"2015-05-06T19:03:11Z","git_url":"git://github.com/swipely/aviator.git","ssh_url":"git@github.com:swipely/aviator.git","clone_url":"https://github.com/swipely/aviator.git","svn_url":"https://github.com/swipely/aviator","homepage":"","size":1382,"stargazers_count":60,"watchers_count":60,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":60,"default_branch":"master"}},"base":{"label":"swipely:master","ref":"master","sha":"5305e9710f12420e58ab8704d99edf38abedde63","user":{"login":"swipely","id":58479,"avatar_url":"https://avatars.githubusercontent.com/u/58479?v=3","gravatar_id":"","url":"https://api.github.com/users/swipely","html_url":"https://github.com/swipely","followers_url":"https://api.github.com/users/swipely/followers","following_url":"https://api.github.com/users/swipely/following{/other_user}","gists_url":"https://api.github.com/users/swipely/gists{/gist_id}","starred_url":"https://api.github.com/users/swipely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swipely/subscriptions","organizations_url":"https://api.github.com/users/swipely/orgs","repos_url":"https://api.github.com/users/swipely/repos","events_url":"https://api.github.com/users/swipely/events{/privacy}","received_events_url":"https://api.github.com/users/swipely/received_events","type":"Organization","site_admin":false},"repo":{"id":10647349,"name":"aviator","full_name":"swipely/aviator","owner":{"login":"swipely","id":58479,"avatar_url":"https://avatars.githubusercontent.com/u/58479?v=3","gravatar_id":"","url":"https://api.github.com/users/swipely","html_url":"https://github.com/swipely","followers_url":"https://api.github.com/users/swipely/followers","following_url":"https://api.github.com/users/swipely/following{/other_user}","gists_url":"https://api.github.com/users/swipely/gists{/gist_id}","starred_url":"https://api.github.com/users/swipely/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swipely/subscriptions","organizations_url":"https://api.github.com/users/swipely/orgs","repos_url":"https://api.github.com/users/swipely/repos","events_url":"https://api.github.com/users/swipely/events{/privacy}","received_events_url":"https://api.github.com/users/swipely/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swipely/aviator","description":"Aviator is a single-page front-end router built for modularity.","fork":false,"url":"https://api.github.com/repos/swipely/aviator","forks_url":"https://api.github.com/repos/swipely/aviator/forks","keys_url":"https://api.github.com/repos/swipely/aviator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swipely/aviator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swipely/aviator/teams","hooks_url":"https://api.github.com/repos/swipely/aviator/hooks","issue_events_url":"https://api.github.com/repos/swipely/aviator/issues/events{/number}","events_url":"https://api.github.com/repos/swipely/aviator/events","assignees_url":"https://api.github.com/repos/swipely/aviator/assignees{/user}","branches_url":"https://api.github.com/repos/swipely/aviator/branches{/branch}","tags_url":"https://api.github.com/repos/swipely/aviator/tags","blobs_url":"https://api.github.com/repos/swipely/aviator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swipely/aviator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swipely/aviator/git/refs{/sha}","trees_url":"https://api.github.com/repos/swipely/aviator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swipely/aviator/statuses/{sha}","languages_url":"https://api.github.com/repos/swipely/aviator/languages","stargazers_url":"https://api.github.com/repos/swipely/aviator/stargazers","contributors_url":"https://api.github.com/repos/swipely/aviator/contributors","subscribers_url":"https://api.github.com/repos/swipely/aviator/subscribers","subscription_url":"https://api.github.com/repos/swipely/aviator/subscription","commits_url":"https://api.github.com/repos/swipely/aviator/commits{/sha}","git_commits_url":"https://api.github.com/repos/swipely/aviator/git/commits{/sha}","comments_url":"https://api.github.com/repos/swipely/aviator/comments{/number}","issue_comment_url":"https://api.github.com/repos/swipely/aviator/issues/comments{/number}","contents_url":"https://api.github.com/repos/swipely/aviator/contents/{+path}","compare_url":"https://api.github.com/repos/swipely/aviator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swipely/aviator/merges","archive_url":"https://api.github.com/repos/swipely/aviator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swipely/aviator/downloads","issues_url":"https://api.github.com/repos/swipely/aviator/issues{/number}","pulls_url":"https://api.github.com/repos/swipely/aviator/pulls{/number}","milestones_url":"https://api.github.com/repos/swipely/aviator/milestones{/number}","notifications_url":"https://api.github.com/repos/swipely/aviator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swipely/aviator/labels{/name}","releases_url":"https://api.github.com/repos/swipely/aviator/releases{/id}","created_at":"2013-06-12T16:53:45Z","updated_at":"2015-04-30T20:56:54Z","pushed_at":"2015-05-06T19:03:11Z","git_url":"git://github.com/swipely/aviator.git","ssh_url":"git@github.com:swipely/aviator.git","clone_url":"https://github.com/swipely/aviator.git","svn_url":"https://github.com/swipely/aviator","homepage":"","size":1382,"stargazers_count":60,"watchers_count":60,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":60,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swipely/aviator/pulls/65"},"html":{"href":"https://github.com/swipely/aviator/pull/65"},"issue":{"href":"https://api.github.com/repos/swipely/aviator/issues/65"},"comments":{"href":"https://api.github.com/repos/swipely/aviator/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/swipely/aviator/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/swipely/aviator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swipely/aviator/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/swipely/aviator/statuses/fb23f854b2f6642b8a5453850b98afe746132a58"}}}}