Commit 65b858a7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'show_files_with_diff_name' into 'master'

Show files named diff

Fixes #1749

See merge request !1318
parents feb7c2bc 1d0dfd50
...@@ -191,7 +191,7 @@ Gitlab::Application.routes.draw do ...@@ -191,7 +191,7 @@ Gitlab::Application.routes.draw do
end end
scope module: :projects do scope module: :projects do
resources :blob, only: [:show, :destroy], constraints: { id: /.+/ } do resources :blob, only: [:show, :destroy], constraints: { id: /.+/, format: false } do
get :diff, on: :member get :diff, on: :member
end end
resources :raw, only: [:show], constraints: {id: /.+/} resources :raw, only: [:show], constraints: {id: /.+/}
......
...@@ -417,6 +417,7 @@ describe Projects::BlobController, "routing" do ...@@ -417,6 +417,7 @@ describe Projects::BlobController, "routing" do
it "to #show" do it "to #show" do
get("/gitlab/gitlabhq/blob/master/app/models/project.rb").should route_to('projects/blob#show', project_id: 'gitlab/gitlabhq', id: 'master/app/models/project.rb') get("/gitlab/gitlabhq/blob/master/app/models/project.rb").should route_to('projects/blob#show', project_id: 'gitlab/gitlabhq', id: 'master/app/models/project.rb')
get("/gitlab/gitlabhq/blob/master/app/models/compare.rb").should route_to('projects/blob#show', project_id: 'gitlab/gitlabhq', id: 'master/app/models/compare.rb') get("/gitlab/gitlabhq/blob/master/app/models/compare.rb").should route_to('projects/blob#show', project_id: 'gitlab/gitlabhq', id: 'master/app/models/compare.rb')
get("/gitlab/gitlabhq/blob/master/app/models/diff.js").should route_to('projects/blob#show', project_id: 'gitlab/gitlabhq', id: 'master/app/models/diff.js')
get("/gitlab/gitlabhq/blob/master/files.scss").should route_to('projects/blob#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss') get("/gitlab/gitlabhq/blob/master/files.scss").should route_to('projects/blob#show', project_id: 'gitlab/gitlabhq', id: 'master/files.scss')
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment