Read about our upcoming Code of Conduct on this issue

Unverified Commit 7e42c229 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix 404 error when visit group label edit page


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 25a37eca1345
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 @@
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