Fix backbone router for URLs with trailing slashes

parent 34e3fb2e
......@@ -2,35 +2,34 @@
app.Router = Backbone.Router.extend({
routes: {
"activity": "stream",
"admin/pods": "adminPods",
"admins/dashboard": "adminDashboard",
"aspects": "aspects",
"commented": "stream",
"community_spotlight": "spotlight",
"contacts": "contacts",
"conversations": "conversations",
"followed_tags": "followed_tags",
"getting_started": "gettingStarted",
"help": "help",
"help/": "help",
"help/:section": "help",
"liked": "stream",
"mentions": "stream",
"notifications": "notifications",
"p/:id": "singlePost",
"people": "pageWithAspectMembershipDropdowns",
"people/:id": "profile",
"people/:id/contacts": "profile",
"people/:id/photos": "photos",
"posts/:id": "singlePost",
"profile/edit": "settings",
"public": "stream",
"stream": "stream",
"tags/:name": "followed_tags",
"u/:name": "profile",
"user/edit": "settings",
"users/sign_up": "registration"
"activity(/)": "stream",
"admin/pods(/)": "adminPods",
"admins/dashboard(/)": "adminDashboard",
"aspects(/)": "aspects",
"commented(/)": "stream",
"community_spotlight(/)": "spotlight",
"contacts(/)": "contacts",
"conversations(/)": "conversations",
"followed_tags(/)": "followed_tags",
"getting_started(/)": "gettingStarted",
"help(/)": "help",
"help/:section(/)": "help",
"liked(/)": "stream",
"mentions(/)": "stream",
"notifications(/)": "notifications",
"p/:id(/)": "singlePost",
"people(/)": "pageWithAspectMembershipDropdowns",
"people/:id(/)": "profile",
"people/:id/contacts(/)": "profile",
"people/:id/photos(/)": "photos",
"posts/:id(/)": "singlePost",
"profile/edit(/)": "settings",
"public(/)": "stream",
"stream(/)": "stream",
"tags/:name(/)": "followed_tags",
"u/:name(/)": "profile",
"user/edit(/)": "settings",
"users/sign_up(/)": "registration"
},
initialize: function() {
......
......@@ -93,6 +93,11 @@ describe('app.Router', function () {
app.router.navigate("/getting_started", {trigger: true});
expect(app.page.$el.selector).toEqual("#hello-there");
});
it("renders app.pages.GettingStarted when the URL has a trailing slash", function() {
app.router.navigate("/getting_started/", {trigger: true});
expect(app.page.$el.selector).toEqual("#hello-there");
});
});
describe("_initializeStreamView", function() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment