Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-17 15:06:48 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-17 15:06:48 +0300
commitbd860c22f6a4b9473cbddd34a53eead8235a7ea1 (patch)
tree3f955a56c2ac90497863da26902a42dba49f3466 /spec/support/shared_examples/requests
parente567b4c2df7dc4085d213db029eff6b6fcde0152 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples/requests')
-rw-r--r--spec/support/shared_examples/requests/api/issues_shared_examples.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/support/shared_examples/requests/api/issues_shared_examples.rb b/spec/support/shared_examples/requests/api/issues_shared_examples.rb
index 1133e95e44e..d22210edf99 100644
--- a/spec/support/shared_examples/requests/api/issues_shared_examples.rb
+++ b/spec/support/shared_examples/requests/api/issues_shared_examples.rb
@@ -8,6 +8,13 @@ shared_examples 'labeled issues with labels and label_name params' do
end
end
+ shared_examples 'returns negated label names' do
+ it 'returns label names' do
+ expect_paginated_array_response(issue2.id)
+ expect(json_response.first['labels']).to eq([label_b.title, label.title])
+ end
+ end
+
shared_examples 'returns basic label entity' do
it 'returns basic label entity' do
expect_paginated_array_response(issue.id)
@@ -28,6 +35,20 @@ shared_examples 'labeled issues with labels and label_name params' do
it_behaves_like 'returns label names'
end
+ context 'negation' do
+ context 'array of labeled issues when all labels match with negation' do
+ let(:params) { { labels: "#{label.title},#{label_b.title}", not: { labels: "#{label_c.title}" } } }
+
+ it_behaves_like 'returns negated label names'
+ end
+
+ context 'array of labeled issues when all labels match with negation with label params as array' do
+ let(:params) { { labels: [label.title, label_b.title], not: { labels: [label_c.title] } } }
+
+ it_behaves_like 'returns negated label names'
+ end
+ end
+
context 'when with_labels_details provided' do
context 'array of labeled issues when all labels match' do
let(:params) { { labels: "#{label.title},#{label_b.title},#{label_c.title}", with_labels_details: true } }