summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/routes.rb2
-rw-r--r--spec/routing/project_routing_spec.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 47c8a4122f5..88667db130e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -166,12 +166,12 @@ Gitlab::Application.routes.draw do
get "files"
end
+ resources :blob, only: [:show], constraints: {id: /.+/}
resources :tree, only: [:show, :edit, :update], constraints: {id: /.+/}
resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
resources :commits, only: [:show], constraints: {id: /.+/}
resources :compare, only: [:index, :create]
resources :blame, only: [:show], constraints: {id: /.+/}
- resources :blob, only: [:show], constraints: {id: /.+/}
resources :graph, only: [:show], constraints: {id: /.+/}
match "/compare/:from...:to" => "compare#show", as: "compare",
:via => [:get, :post], constraints: {from: /.+/, to: /.+/}
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
index f94bedc79a1..9cf5d91349f 100644
--- a/spec/routing/project_routing_spec.rb
+++ b/spec/routing/project_routing_spec.rb
@@ -392,6 +392,7 @@ end
describe BlobController, "routing" do
it "to #show" do
get("/gitlabhq/blob/master/app/models/project.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
+ get("/gitlabhq/blob/master/app/models/compare.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/compare.rb')
end
end