summaryrefslogtreecommitdiff
path: root/spec/helpers/users_helper_spec.rb
diff options
context:
space:
mode:
authorJX Terry <jxterry@protonmail.com>2018-07-24 12:46:19 +0000
committerDouwe Maan <douwe@gitlab.com>2018-07-24 12:46:19 +0000
commit99011a61cf4136c806e7de43fcd55475d2407fa1 (patch)
tree99486b31dc0df1b86db0bb11ec32b05c9bc1fb2d /spec/helpers/users_helper_spec.rb
parentadc327d3fa72b9f5b9c42c629c99f0a89ca15192 (diff)
downloadgitlab-ce-99011a61cf4136c806e7de43fcd55475d2407fa1.tar.gz
Add an option to have a private profile on GitLab
Diffstat (limited to 'spec/helpers/users_helper_spec.rb')
-rw-r--r--spec/helpers/users_helper_spec.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/helpers/users_helper_spec.rb b/spec/helpers/users_helper_spec.rb
index b18c045848f..b079802cb81 100644
--- a/spec/helpers/users_helper_spec.rb
+++ b/spec/helpers/users_helper_spec.rb
@@ -25,8 +25,20 @@ describe UsersHelper do
allow(helper).to receive(:can?).and_return(true)
end
- it 'includes all the expected tabs' do
- expect(tabs).to include(:activity, :groups, :contributed, :projects, :snippets)
+ context 'with public profile' do
+ it 'includes all the expected tabs' do
+ expect(tabs).to include(:activity, :groups, :contributed, :projects, :snippets)
+ end
+ end
+
+ context 'with private profile' do
+ before do
+ allow(helper).to receive(:can?).with(user, :read_user_profile, nil).and_return(false)
+ end
+
+ it 'is empty' do
+ expect(tabs).to be_empty
+ end
end
end