summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorMark Fletcher <mark@gitlab.com>2018-01-04 16:35:44 +0000
committerMark Fletcher <mark@gitlab.com>2018-01-21 16:36:55 +0000
commit062f5b7126978e08522361e879d7c1723b15c9da (patch)
tree9aee4c80a7803b8f208be8a2be909a6dd3b5da0f /spec/requests
parentee58763158ed10f12a8fe7c089257a532fe6e724 (diff)
downloadgitlab-ce-062f5b7126978e08522361e879d7c1723b15c9da.tar.gz
Fix error on empty query for Members API
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/members_spec.rb10
-rw-r--r--spec/requests/api/v3/members_spec.rb10
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/requests/api/members_spec.rb b/spec/requests/api/members_spec.rb
index 5d4f81e07a6..73bd4785b11 100644
--- a/spec/requests/api/members_spec.rb
+++ b/spec/requests/api/members_spec.rb
@@ -65,6 +65,16 @@ describe API::Members do
expect(json_response.count).to eq(1)
expect(json_response.first['username']).to eq(master.username)
end
+
+ it 'finds all members with no query specified' do
+ get api("/#{source_type.pluralize}/#{source.id}/members", developer), query: ''
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(response).to include_pagination_headers
+ expect(json_response).to be_an Array
+ expect(json_response.count).to eq(2)
+ expect(json_response.map { |u| u['id'] }).to match_array [master.id, developer.id]
+ end
end
end
diff --git a/spec/requests/api/v3/members_spec.rb b/spec/requests/api/v3/members_spec.rb
index b91782ae511..de4339ecb8b 100644
--- a/spec/requests/api/v3/members_spec.rb
+++ b/spec/requests/api/v3/members_spec.rb
@@ -58,6 +58,16 @@ describe API::V3::Members do
expect(json_response.count).to eq(1)
expect(json_response.first['username']).to eq(master.username)
end
+
+ it 'finds all members with no query specified' do
+ get v3_api("/#{source_type.pluralize}/#{source.id}/members", developer), query: ''
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(response).to include_pagination_headers
+ expect(json_response).to be_an Array
+ expect(json_response.count).to eq(2)
+ expect(json_response.map { |u| u['id'] }).to match_array [master.id, developer.id]
+ end
end
end