{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/9885","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/9885/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/9885/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/9885/events","html_url":"https://github.com/edx/edx-platform/pull/9885","id":107915784,"number":9885,"title":"Improve team testing of routers","user":{"login":"andy-armstrong","id":5985072,"avatar_url":"https://avatars.githubusercontent.com/u/5985072?v=3","gravatar_id":"","url":"https://api.github.com/users/andy-armstrong","html_url":"https://github.com/andy-armstrong","followers_url":"https://api.github.com/users/andy-armstrong/followers","following_url":"https://api.github.com/users/andy-armstrong/following{/other_user}","gists_url":"https://api.github.com/users/andy-armstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-armstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-armstrong/subscriptions","organizations_url":"https://api.github.com/users/andy-armstrong/orgs","repos_url":"https://api.github.com/users/andy-armstrong/repos","events_url":"https://api.github.com/users/andy-armstrong/events{/privacy}","received_events_url":"https://api.github.com/users/andy-armstrong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-23T13:11:50Z","updated_at":"2015-09-23T16:46:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/9885","html_url":"https://github.com/edx/edx-platform/pull/9885","diff_url":"https://github.com/edx/edx-platform/pull/9885.diff","patch_url":"https://github.com/edx/edx-platform/pull/9885.patch"},"body":"I found that there were issues with the way we were testing the Backbone routers. In particular, the browser's history was being updated when each test was run, which meant that subsequent tests would often start from an unexpected history rather than from a blank slate. This change introduces a helper which installs two spies that mock out Backbone's handling of a browser's hash, thus ensuring that the code behaves consistently while ensuring that the browser doesn't actually navigate.\r\n\r\nI developed this based upon answers in this Stack Overflow question, but none of them worked for me. I've posted my own answer with this helper function, so if you like the approach then please vote for my answer!\r\n\r\nhttp://stackoverflow.com/questions/9215737/testing-routers-in-backbone-js-properly/32727474#32727474\r\n\r\n### Reviewers\r\nIf you've been tagged for review, please check your corresponding box once you've given the :+1:.\r\n- [x] Code review: @cahrens \r\n- [x] Code review: @peter-fogg  \r\n \r\nFYI: @dan-f @jzoldak \r\n \r\n### Post-review\r\n- [ ] Squash commits"},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/142658840","html_url":"https://github.com/edx/edx-platform/pull/9885#issuecomment-142658840","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/9885","id":142658840,"user":{"login":"andy-armstrong","id":5985072,"avatar_url":"https://avatars.githubusercontent.com/u/5985072?v=3","gravatar_id":"","url":"https://api.github.com/users/andy-armstrong","html_url":"https://github.com/andy-armstrong","followers_url":"https://api.github.com/users/andy-armstrong/followers","following_url":"https://api.github.com/users/andy-armstrong/following{/other_user}","gists_url":"https://api.github.com/users/andy-armstrong/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-armstrong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-armstrong/subscriptions","organizations_url":"https://api.github.com/users/andy-armstrong/orgs","repos_url":"https://api.github.com/users/andy-armstrong/repos","events_url":"https://api.github.com/users/andy-armstrong/events{/privacy}","received_events_url":"https://api.github.com/users/andy-armstrong/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T16:46:08Z","updated_at":"2015-09-23T16:46:08Z","body":"@peter-fogg Which tests are you thinking of? I'd like to get them all addressed."}}