From bb7df7663a8952d60abea015f823b7acbc8c49c2 Mon Sep 17 00:00:00 2001 From: GitLab Date: Sun, 13 Apr 2014 17:46:41 +0200 Subject: Add short path route for groups. --- config/routes.rb | 2 ++ spec/routing/routing_spec.rb | 12 ++++++++++++ 2 files changed, 14 insertions(+) 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..52a9e113e31 100644 --- a/spec/routing/routing_spec.rb +++ b/spec/routing/routing_spec.rb @@ -238,3 +238,15 @@ 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 "redirect" do + # get("/groups/1").should redirect_to("/groups/1") + get("/1").should route_to('groups#show', id: '1') + end +end + -- cgit v1.2.1