diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-14 18:06:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-14 18:06:24 +0000 |
commit | 8c30d396c5a789080345303330069981aa06e4af (patch) | |
tree | 6fd96c7c80bec2f1101af34d749ada58e59b38ee /spec | |
parent | 429d1abad29d379d8bc8f5219eb72384ad485deb (diff) | |
download | gitlab-ce-8c30d396c5a789080345303330069981aa06e4af.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/boards/sidebar_spec.rb | 31 | ||||
-rw-r--r-- | spec/finders/todos_finder_spec.rb | 37 |
2 files changed, 37 insertions, 31 deletions
diff --git a/spec/features/boards/sidebar_spec.rb b/spec/features/boards/sidebar_spec.rb index 2fc79272c21..2b923df40c5 100644 --- a/spec/features/boards/sidebar_spec.rb +++ b/spec/features/boards/sidebar_spec.rb @@ -14,8 +14,6 @@ describe 'Issue Boards', :js do let!(:bug) { create(:label, project: project, name: 'Bug') } let!(:regression) { create(:label, project: project, name: 'Regression') } let!(:stretch) { create(:label, project: project, name: 'Stretch') } - let!(:scoped_label_1) { create(:label, project: project, name: 'Scoped::Label1') } - let!(:scoped_label_2) { create(:label, project: project, name: 'Scoped::Label2') } let!(:issue1) { create(:labeled_issue, project: project, assignees: [user], milestone: milestone, labels: [development], relative_position: 2) } let!(:issue2) { create(:labeled_issue, project: project, labels: [development, stretch], relative_position: 1) } let(:board) { create(:board, project: project) } @@ -29,8 +27,6 @@ describe 'Issue Boards', :js do end before do - stub_licensed_features(scoped_labels: true) - project.add_maintainer(user) sign_in(user) @@ -313,33 +309,6 @@ describe 'Issue Boards', :js do expect(card).to have_content(bug.title) end - it 'removes existing scoped label' do - click_card(card) - - page.within('.labels') do - click_link 'Edit' - - wait_for_requests - - click_link scoped_label_1.title - click_link scoped_label_2.title - - wait_for_requests - - find('.dropdown-menu-close-icon').click - - page.within('.value') do - expect(page).to have_selector('.badge', count: 3) - expect(page).not_to have_content(scoped_label_1.title) - expect(page).to have_content(scoped_label_2.title) - end - end - - expect(card).to have_selector('.badge', count: 3) - expect(card).not_to have_content(scoped_label_1.title) - expect(card).to have_content(scoped_label_2.title) - end - it 'adds a multiple labels' do click_card(card) diff --git a/spec/finders/todos_finder_spec.rb b/spec/finders/todos_finder_spec.rb index f7b35e76925..a0bf48f218a 100644 --- a/spec/finders/todos_finder_spec.rb +++ b/spec/finders/todos_finder_spec.rb @@ -36,6 +36,43 @@ describe TodosFinder do expect(todos).to match_array([todo1]) end + context 'when filtering for actions' do + let!(:todo1) { create(:todo, user: user, project: project, target: issue, action: Todo::ASSIGNED) } + let!(:todo2) { create(:todo, user: user, group: group, target: merge_request, action: Todo::DIRECTLY_ADDRESSED) } + + context 'by action ids' do + it 'returns the expected todos' do + todos = finder.new(user, { action_id: Todo::DIRECTLY_ADDRESSED }).execute + + expect(todos).to match_array([todo2]) + end + + context 'multiple actions' do + it 'returns the expected todos' do + todos = finder.new(user, { action_id: [Todo::DIRECTLY_ADDRESSED, Todo::ASSIGNED] }).execute + + expect(todos).to match_array([todo2, todo1]) + end + end + end + + context 'by action names' do + it 'returns the expected todos' do + todos = finder.new(user, { action: :directly_addressed }).execute + + expect(todos).to match_array([todo2]) + end + + context 'multiple actions' do + it 'returns the expected todos' do + todos = finder.new(user, { action: [:directly_addressed, :assigned] }).execute + + expect(todos).to match_array([todo2, todo1]) + end + end + end + end + context 'with subgroups' do let(:subgroup) { create(:group, parent: group) } let!(:todo3) { create(:todo, user: user, group: subgroup, target: issue) } |