summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorAlexander Randa <randa.alex@gmail.com>2017-03-27 13:43:21 +0000
committerAlexander Randa <randa.alex@gmail.com>2017-03-28 17:43:55 +0300
commitc4be3460c202cf8c33429ddca8f0f8383907ac60 (patch)
tree774855670f155efd39aee680c281445e59f51d00 /spec/requests
parentf74e9245cb18582caa79abd4b7c0b942b9dae851 (diff)
downloadgitlab-ce-c4be3460c202cf8c33429ddca8f0f8383907ac60.tar.gz
Fix API group/issues default state filter
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/issues_spec.rb20
-rw-r--r--spec/requests/api/v3/issues_spec.rb20
2 files changed, 28 insertions, 12 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb
index 52f68fed2cc..91d6fb83c0b 100644
--- a/spec/requests/api/issues_spec.rb
+++ b/spec/requests/api/issues_spec.rb
@@ -333,8 +333,16 @@ describe API::Issues, api: true do
end
let(:base_url) { "/groups/#{group.id}/issues" }
+ it 'returns all group issues (including opened and closed)' do
+ get api(base_url, admin)
+
+ expect(response).to have_http_status(200)
+ expect(json_response).to be_an Array
+ expect(json_response.length).to eq(3)
+ end
+
it 'returns group issues without confidential issues for non project members' do
- get api(base_url, non_member)
+ get api("#{base_url}?state=opened", non_member)
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
@@ -344,7 +352,7 @@ describe API::Issues, api: true do
end
it 'returns group confidential issues for author' do
- get api(base_url, author)
+ get api("#{base_url}?state=opened", author)
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
@@ -353,7 +361,7 @@ describe API::Issues, api: true do
end
it 'returns group confidential issues for assignee' do
- get api(base_url, assignee)
+ get api("#{base_url}?state=opened", assignee)
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
@@ -362,7 +370,7 @@ describe API::Issues, api: true do
end
it 'returns group issues with confidential issues for project members' do
- get api(base_url, user)
+ get api("#{base_url}?state=opened", user)
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
@@ -371,7 +379,7 @@ describe API::Issues, api: true do
end
it 'returns group confidential issues for admin' do
- get api(base_url, admin)
+ get api("#{base_url}?state=opened", admin)
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
@@ -460,7 +468,7 @@ describe API::Issues, api: true do
end
it 'returns an array of issues in given milestone' do
- get api("#{base_url}?milestone=#{group_milestone.title}", user)
+ get api("#{base_url}?state=opened&milestone=#{group_milestone.title}", user)
expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
diff --git a/spec/requests/api/v3/issues_spec.rb b/spec/requests/api/v3/issues_spec.rb
index 51021eec63c..383871d5c38 100644
--- a/spec/requests/api/v3/issues_spec.rb
+++ b/spec/requests/api/v3/issues_spec.rb
@@ -285,8 +285,16 @@ describe API::V3::Issues, api: true do
end
let(:base_url) { "/groups/#{group.id}/issues" }
+ it 'returns all group issues (including opened and closed)' do
+ get v3_api(base_url, admin)
+
+ expect(response).to have_http_status(200)
+ expect(json_response).to be_an Array
+ expect(json_response.length).to eq(3)
+ end
+
it 'returns group issues without confidential issues for non project members' do
- get v3_api(base_url, non_member)
+ get v3_api("#{base_url}?state=opened", non_member)
expect(response).to have_http_status(200)
expect(json_response).to be_an Array
@@ -295,7 +303,7 @@ describe API::V3::Issues, api: true do
end
it 'returns group confidential issues for author' do
- get v3_api(base_url, author)
+ get v3_api("#{base_url}?state=opened", author)
expect(response).to have_http_status(200)
expect(json_response).to be_an Array
@@ -303,7 +311,7 @@ describe API::V3::Issues, api: true do
end
it 'returns group confidential issues for assignee' do
- get v3_api(base_url, assignee)
+ get v3_api("#{base_url}?state=opened", assignee)
expect(response).to have_http_status(200)
expect(json_response).to be_an Array
@@ -311,7 +319,7 @@ describe API::V3::Issues, api: true do
end
it 'returns group issues with confidential issues for project members' do
- get v3_api(base_url, user)
+ get v3_api("#{base_url}?state=opened", user)
expect(response).to have_http_status(200)
expect(json_response).to be_an Array
@@ -319,7 +327,7 @@ describe API::V3::Issues, api: true do
end
it 'returns group confidential issues for admin' do
- get v3_api(base_url, admin)
+ get v3_api("#{base_url}?state=opened", admin)
expect(response).to have_http_status(200)
expect(json_response).to be_an Array
@@ -368,7 +376,7 @@ describe API::V3::Issues, api: true do
end
it 'returns an array of issues in given milestone' do
- get v3_api("#{base_url}?milestone=#{group_milestone.title}", user)
+ get v3_api("#{base_url}?state=opened&milestone=#{group_milestone.title}", user)
expect(response).to have_http_status(200)
expect(json_response).to be_an Array