Merge branch 'issue-boards-sidebar-create-new-label-404-error' into 'master'

Fixed create label form not working on issue boards in a sub-group project

Closes #31862

See merge request !11182
This commit is contained in:
Filipa Lacerda 2017-05-10 14:09:00 +00:00
commit 46a6fb3880
3 changed files with 50 additions and 1 deletions

View file

@ -19,7 +19,7 @@
":value" => "label.id" }
.dropdown
%button.dropdown-menu-toggle.js-label-select.js-multiselect.js-issue-board-sidebar{ type: "button",
data: { toggle: "dropdown", field_name: "issue[label_names][]", show_no: "true", show_any: "true", project_id: @project.id, labels: namespace_project_labels_path(@project.namespace, @project, :json), namespace_path: @project.try(:namespace).try(:path), project_path: @project.try(:path) },
data: { toggle: "dropdown", field_name: "issue[label_names][]", show_no: "true", show_any: "true", project_id: @project.id, labels: namespace_project_labels_path(@project.namespace, @project, :json), namespace_path: @project.try(:namespace).try(:full_path), project_path: @project.try(:path) },
":data-issue-update" => "'#{namespace_project_issues_path(@project.namespace, @project)}/' + issue.id + '.json'" }
%span.dropdown-toggle-text
Label

View file

@ -0,0 +1,4 @@
---
title: Fixed create new label form in issue boards sidebar
merge_request:
author:

View file

@ -0,0 +1,45 @@
require 'rails_helper'
describe 'Sub-group project issue boards', :feature, :js do
include WaitForVueResource
let(:group) { create(:group) }
let(:nested_group_1) { create(:group, parent: group) }
let(:project) { create(:empty_project, group: nested_group_1) }
let(:board) { create(:board, project: project) }
let(:label) { create(:label, project: project) }
let(:user) { create(:user) }
let!(:list1) { create(:list, board: board, label: label, position: 0) }
let!(:issue) { create(:labeled_issue, project: project, labels: [label]) }
before do
project.add_master(user)
login_as(user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_vue_resource
end
it 'creates new label from sidebar' do
find('.card').click
page.within '.labels' do
click_link 'Edit'
click_link 'Create new label'
end
page.within '.dropdown-new-label' do
fill_in 'new_label_name', with: 'test label'
first('.suggest-colors-dropdown a').click
click_button 'Create'
wait_for_ajax
end
page.within '.labels' do
expect(page).to have_link 'test label'
end
end
end