Commit 084dde9e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'dz-revert-revert' into 'master'

Revert "Revert "Change "Group#web_url" to return "/groups/twitter" rather than "/twitter".""

Looks like I accidently reverted https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7035 although I did not want to . This MR reverts my revert.

See merge request !7127
parents b3210df3 3be445c5
...@@ -68,7 +68,7 @@ class Group < Namespace ...@@ -68,7 +68,7 @@ class Group < Namespace
end end
def web_url def web_url
Gitlab::Routing.url_helpers.group_url(self) Gitlab::Routing.url_helpers.group_canonical_url(self)
end end
def human_name def human_name
......
...@@ -12,23 +12,26 @@ constraints(GroupUrlConstrainer.new) do ...@@ -12,23 +12,26 @@ constraints(GroupUrlConstrainer.new) do
end end
end end
resources :groups, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } do scope constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ } do
member do resources :groups, except: [:show] do
get :issues member do
get :merge_requests get :issues
get :projects get :merge_requests
get :activity get :projects
end get :activity
scope module: :groups do
resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do
post :resend_invite, on: :member
delete :leave, on: :collection
end end
resource :avatar, only: [:destroy] scope module: :groups do
resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create] resources :group_members, only: [:index, :create, :update, :destroy], concerns: :access_requestable do
post :resend_invite, on: :member
delete :leave, on: :collection
end
resources :labels, except: [:show], constraints: { id: /\d+/ } resource :avatar, only: [:destroy]
resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
resources :labels, except: [:show], constraints: { id: /\d+/ }
end
end end
get 'groups/:id' => 'groups#show', as: :group_canonical
end end
...@@ -265,4 +265,10 @@ describe Group, models: true do ...@@ -265,4 +265,10 @@ describe Group, models: true do
members members
end end
describe '#web_url' do
it 'returns the canonical URL' do
expect(group.web_url).to include("groups/#{group.name}")
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