summaryrefslogtreecommitdiff
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-04 15:59:17 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-04 15:59:17 +0000
commitb9219469f759f387a35bec39c3dc59477793ef1b (patch)
treec6f97d7545fd6d44d041b3192974e325dee01854 /spec/models/user_spec.rb
parent1d945945bb66871dcebefef5824740c823fd7b09 (diff)
parent67992b9be6fc19ef4cc06de48995d1ee9617049a (diff)
downloadgitlab-ce-b9219469f759f387a35bec39c3dc59477793ef1b.tar.gz
Merge branch 'make-namespaces-api-available-to-all-users' into 'master'
Make namespace API available to all users ### What does this MR do? This MR makes it possible for a user to query namespaces to which he/she has access. Also, it adds documentation for the existing API. ### Why was this MR needed? Even though the `groups` API exists, it might still be useful to have an endpoint that tells the namespace type (e.g. `user` vs. `group`), especially if a user has access to a number of different projects. ### What are the relevant issue numbers? Closes https://github.com/gitlabhq/gitlabhq/issues/9328 See merge request !708
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 49c7b7d99ce..be0b70395d6 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -248,6 +248,7 @@ describe User do
it { expect(@user.several_namespaces?).to be_truthy }
it { expect(@user.authorized_groups).to eq([@group]) }
it { expect(@user.owned_groups).to eq([@group]) }
+ it { expect(@user.namespaces).to match_array([@user.namespace, @group]) }
end
describe 'group multiple owners' do
@@ -270,6 +271,7 @@ describe User do
end
it { expect(@user.several_namespaces?).to be_falsey }
+ it { expect(@user.namespaces).to eq([@user.namespace]) }
end
describe 'blocking user' do