diff --git a/config/routes.rb b/config/routes.rb index 709b66d3e06d268a017c27f752fb68dbe532adb2..f23542cc8931aa5bab6780f75bd4afe6f856b9be 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 9b67cd432bc1f008613f5529a7f2486c27c5eb99..a2d2a35140c972f4c9511bbf845c466e4796e6e3 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 +