diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-10-13 14:58:53 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-11-01 16:25:02 +0300 |
commit | 8ea63cdada06d36adee3fa57ed49d20b949544db (patch) | |
tree | 2663d6754d11d750922989dd2b42fe76b17d3bca | |
parent | 5b68b53bb2f1b915424bd57f7d6b84977d58c291 (diff) |
Merge branch 'backport-ee-2869' into 'master'
backport for gitlab-ee!2869
See merge request gitlab-org/gitlab-ce!14505
# Conflicts:
# spec/features/boards/sidebar_spec.rb
-rw-r--r-- | app/views/shared/boards/components/sidebar/_labels.html.haml | 2 | ||||
-rw-r--r-- | spec/features/boards/sidebar_spec.rb | 34 | ||||
-rw-r--r-- | spec/support/board_helpers.rb | 16 |
3 files changed, 35 insertions, 17 deletions
diff --git a/app/views/shared/boards/components/sidebar/_labels.html.haml b/app/views/shared/boards/components/sidebar/_labels.html.haml index 1f540bdaf93..dfc0f9be321 100644 --- a/app/views/shared/boards/components/sidebar/_labels.html.haml +++ b/app/views/shared/boards/components/sidebar/_labels.html.haml @@ -25,7 +25,7 @@ show_any: "true", project_id: @project&.try(:id), labels: labels_filter_path(false), - namespace_path: @project.try(:namespace).try(:full_path), + namespace_path: @namespace_path, project_path: @project.try(:path) }, ":data-issue-update" => "'#{build_issue_link_base}/' + issue.iid + '.json'" } %span.dropdown-toggle-text diff --git a/spec/features/boards/sidebar_spec.rb b/spec/features/boards/sidebar_spec.rb index c3bf50ef9d1..4965f803883 100644 --- a/spec/features/boards/sidebar_spec.rb +++ b/spec/features/boards/sidebar_spec.rb @@ -1,6 +1,8 @@ require 'rails_helper' -describe 'Issue Boards', js: true do +describe 'Issue Boards', :js do + include BoardHelpers + let(:user) { create(:user) } let(:user2) { create(:user) } let(:project) { create(:project, :public) } @@ -309,6 +311,21 @@ describe 'Issue Boards', js: true do expect(card).to have_selector('.label', count: 1) expect(card).not_to have_content(stretch.title) end + + it 'creates new label' do + click_card(card) + + page.within('.labels') do + click_link 'Edit' + click_link 'Create new label' + fill_in 'new_label_name', with: 'test label' + first('.suggest-colors-dropdown a').click + click_button 'Create' + wait_for_requests + + expect(page).to have_link 'test label' + end + end end context 'subscription' do @@ -322,19 +339,4 @@ describe 'Issue Boards', js: true do end end end - - def click_card(card) - page.within(card) do - first('.card-number').click - end - - wait_for_sidebar - end - - def wait_for_sidebar - # loop until the CSS transition is complete - Timeout.timeout(0.5) do - loop until evaluate_script('$(".right-sidebar").outerWidth()') == 290 - end - end end diff --git a/spec/support/board_helpers.rb b/spec/support/board_helpers.rb new file mode 100644 index 00000000000..507d0432d7f --- /dev/null +++ b/spec/support/board_helpers.rb @@ -0,0 +1,16 @@ +module BoardHelpers + def click_card(card) + within card do + first('.card-number').click + end + + wait_for_sidebar + end + + def wait_for_sidebar + # loop until the CSS transition is complete + Timeout.timeout(0.5) do + loop until evaluate_script('$(".right-sidebar").outerWidth()') == 290 + end + end +end |