diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-15 14:36:52 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-15 14:36:52 +0400 |
commit | fd61e3e9016940e1c4668837472ddd8b952217f6 (patch) | |
tree | c73ee29a310dcf9854c5fb4b598056dbe0d63eaf | |
parent | da4c13f11d717c08936b0ee5f3df7e87aaa5961b (diff) | |
parent | 61ef72e5d1219646778005422e423ebe95433bbb (diff) |
Merge branch 'routing-for-groups' into 'master'
Routing for groups
Implements http://feedback.gitlab.com/forums/176466-general/suggestions/5723800-group-url-on-root-path-groups-name-instead-of-g
-rw-r--r-- | config/routes.rb | 2 | ||||
-rw-r--r-- | spec/routing/routing_spec.rb | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/config/routes.rb b/config/routes.rb index 709b66d3e06..f23542cc893 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -327,5 +327,7 @@ Gitlab::Application.routes.draw do end end + get ':id' => "groups#show", constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} + root to: "dashboard#show" end diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb index 9b67cd432bc..a2d2a35140c 100644 --- a/spec/routing/routing_spec.rb +++ b/spec/routing/routing_spec.rb @@ -238,3 +238,14 @@ end describe "Authentication", "routing" do # pending end + +describe "Groups", "routing" do + it "to #show" do + get("/groups/1").should route_to('groups#show', id: '1') + end + + it "also display group#show on the short path" do + get("/1").should route_to('groups#show', id: '1') + end +end + |