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:
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)