Commit fd61e3e9016940e1c4668837472ddd8b952217f6

Authored by Dmitriy Zaporozhets
2 parents da4c13f1 61ef72e5

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
Showing 2 changed files with 13 additions and 0 deletions   Show diff stats
config/routes.rb
... ... @@ -327,5 +327,7 @@ Gitlab::Application.routes.draw do
327 327 end
328 328 end
329 329  
  330 + get ':id' => "groups#show", constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}
  331 +
330 332 root to: "dashboard#show"
331 333 end
... ...
spec/routing/routing_spec.rb
... ... @@ -238,3 +238,14 @@ end
238 238 describe "Authentication", "routing" do
239 239 # pending
240 240 end
  241 +
  242 +describe "Groups", "routing" do
  243 + it "to #show" do
  244 + get("/groups/1").should route_to('groups#show', id: '1')
  245 + end
  246 +
  247 + it "also display group#show on the short path" do
  248 + get("/1").should route_to('groups#show', id: '1')
  249 + end
  250 +end
  251 +
... ...