Commit 34fc5b05 authored by Rémy Coutable's avatar Rémy Coutable 🔴

Merge branch 'dz-fix-group-label-404' into 'master'

Fix 404 error when visit group label edit page

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/25158

See merge request !7957
parents ff02c63c 7e42c229
resources :groups, only: [:index, :new, :create]
scope(path: 'groups/*id',
controller: :groups,
constraints: { id: Gitlab::Regex.namespace_route_regex }) do
get :edit, as: :edit_group
get :issues, as: :issues_group
get :merge_requests, as: :merge_requests_group
get :projects, as: :projects_group
get :activity, as: :activity_group
end
scope(path: 'groups/*group_id',
module: :groups,
as: :group,
......@@ -22,10 +12,20 @@ scope(path: 'groups/*group_id',
resource :avatar, only: [:destroy]
resources :milestones, constraints: { id: /[^\/]+/ }, only: [:index, :show, :update, :new, :create]
resources :labels, except: [:show], constraints: { id: /\d+/ } do
resources :labels, except: [:show] do
post :toggle_subscription, on: :member
end
end
scope(path: 'groups/*id',
controller: :groups,
constraints: { id: Gitlab::Regex.namespace_route_regex }) do
get :edit, as: :edit_group
get :issues, as: :issues_group
get :merge_requests, as: :merge_requests_group
get :projects, as: :projects_group
get :activity, as: :activity_group
end
# Must be last route in this file
get 'groups/*id' => 'groups#show', as: :group_canonical, constraints: { id: Gitlab::Regex.namespace_route_regex }
require 'spec_helper'
feature 'Edit group label', feature: true do
given(:user) { create(:user) }
given(:group) { create(:group) }
given(:label) { create(:group_label, group: group) }
background do
group.add_owner(user)
login_as(user)
visit edit_group_label_path(group, label)
end
scenario 'update label with new title' do
fill_in 'label_title', with: 'new label name'
click_button 'Save changes'
expect(current_path).to eq(root_path)
expect(label.reload.title).to eq('new label name')
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