diff options
author | Brett Walker <bwalker@gitlab.com> | 2018-10-18 20:06:33 -0500 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2018-10-31 19:01:04 -0500 |
commit | a8869a571b3093004d8777cfe1a3e56a22db0210 (patch) | |
tree | f1bde41b632802a45489ac30de861ef330efe0c6 /spec | |
parent | 31733b6fc5a9ba4443a5dd279e787e2fd8e31c6d (diff) | |
download | gitlab-ce-a8869a571b3093004d8777cfe1a3e56a22db0210.tar.gz |
Dynamically store the valid label endpoint
In order to ensure we have the right endpoint to query for an
issue's possible valid labels, we store that url in the issue
object that gets passed to the frontend.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/groups/board_sidebar_spec.rb | 45 | ||||
-rw-r--r-- | spec/fixtures/api/schemas/issue.json | 1 |
2 files changed, 46 insertions, 0 deletions
diff --git a/spec/features/groups/board_sidebar_spec.rb b/spec/features/groups/board_sidebar_spec.rb new file mode 100644 index 00000000000..9f597efa7b7 --- /dev/null +++ b/spec/features/groups/board_sidebar_spec.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Group Issue Boards', :js do + include BoardHelpers + + let(:group) { create(:group) } + let(:user) { create(:group_member, user: create(:user), group: group ).user } + let!(:project_1) { create(:project, :public, group: group) } + let!(:project_2) { create(:project, :public, group: group) } + let!(:project_1_label) { create(:label, project: project_1, name: 'Development 1') } + let!(:project_2_label) { create(:label, project: project_2, name: 'Development 2') } + let!(:group_label) { create(:group_label, title: 'Bug', description: 'Fusce consequat', group: group) } + let!(:issue_1) { create(:labeled_issue, project: project_1, relative_position: 1) } + let!(:issue_2) { create(:labeled_issue, project: project_2, relative_position: 2) } + let(:board) { create(:board, group: group) } + let!(:list) { create(:list, board: board, label: project_1_label, position: 0) } + let(:card) { find('.board:nth-child(1)').first('.board-card') } + + before do + sign_in(user) + + visit group_board_path(group, board) + wait_for_requests + end + + context 'labels' do + it 'only shows valid labels for the issue project and group' do + click_card(card) + + page.within('.labels') do + click_link 'Edit' + + wait_for_requests + + page.within('.selectbox') do + expect(page).to have_content(project_1_label.title) + expect(page).to have_content(group_label.title) + expect(page).not_to have_content(project_2_label.title) + end + end + end + end +end diff --git a/spec/fixtures/api/schemas/issue.json b/spec/fixtures/api/schemas/issue.json index 8833825e3fb..28f11115428 100644 --- a/spec/fixtures/api/schemas/issue.json +++ b/spec/fixtures/api/schemas/issue.json @@ -15,6 +15,7 @@ "relative_position": { "type": "integer" }, "issue_sidebar_endpoint": { "type": "string" }, "toggle_subscription_endpoint": { "type": "string" }, + "valid_labels_endpoint": { "type": "string" }, "reference_path": { "type": "string" }, "real_path": { "type": "string" }, "project": { |