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:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-06-27 23:35:35 +0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2017-06-28 21:50:29 +0300
commitda3e4f412846b754d31439da0d884181653bced0 (patch)
treee1c6da18204cf5c7990c350c5b9c01501ff60192 /spec/requests/api/namespaces_spec.rb
parent9f44687a14d57fec596b9736584bf8718df75a2e (diff)
Add "members_count" and "parent_id" data on namespaces API
Diffstat (limited to 'spec/requests/api/namespaces_spec.rb')
-rw-r--r--spec/requests/api/namespaces_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/requests/api/namespaces_spec.rb b/spec/requests/api/namespaces_spec.rb
index 3bf16a3ae27..03b1f549ce0 100644
--- a/spec/requests/api/namespaces_spec.rb
+++ b/spec/requests/api/namespaces_spec.rb
@@ -15,6 +15,14 @@ describe API::Namespaces do
end
context "when authenticated as admin" do
+ it "returns correct attributes" do
+ get api("/namespaces", admin)
+
+ expect(response).to have_http_status(200)
+ expect(response).to include_pagination_headers
+ expect(json_response.first).to include('id', 'name', 'path', 'full_path', 'parent_id', 'members_count')
+ end
+
it "admin: returns an array of all namespaces" do
get api("/namespaces", admin)
@@ -37,6 +45,14 @@ describe API::Namespaces do
end
context "when authenticated as a regular user" do
+ it "returns correct attributes" do
+ get api("/namespaces", user)
+
+ expect(response).to have_http_status(200)
+ expect(response).to include_pagination_headers
+ expect(json_response.first).to include('id', 'name', 'path', 'full_path', 'parent_id', 'members_count')
+ end
+
it "user: returns an array of namespaces" do
get api("/namespaces", user)