summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-07-06 09:58:49 +0000
committerDouwe Maan <douwe@gitlab.com>2018-07-06 09:58:49 +0000
commitafb3caac797f5c90af9ff4989a3730299d39e3f1 (patch)
tree4f84b43ec8de671cb5ce96ae3e147c2dc0f6ef29 /spec/helpers
parentf5b12225d8ee8686eddeb35b2851d93631f72c89 (diff)
parenta57ec31e4575d5633341143c7b3a4f0a4350c1ec (diff)
downloadgitlab-ce-afb3caac797f5c90af9ff4989a3730299d39e3f1.tar.gz
Merge branch 'bvl-wrap-cross-project-group-permissions' into 'master'
Create cross project group features See merge request gitlab-org/gitlab-ce!20333
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/groups_helper_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/helpers/groups_helper_spec.rb b/spec/helpers/groups_helper_spec.rb
index 6c94bd4e504..115807f954b 100644
--- a/spec/helpers/groups_helper_spec.rb
+++ b/spec/helpers/groups_helper_spec.rb
@@ -206,8 +206,9 @@ describe GroupsHelper do
let(:group) { create(:group, :public) }
let(:user) { create(:user) }
before do
+ group.add_owner(user)
allow(helper).to receive(:current_user) { user }
- allow(helper).to receive(:can?) { true }
+ allow(helper).to receive(:can?) { |*args| Ability.allowed?(*args) }
helper.instance_variable_set(:@group, group)
end
@@ -231,7 +232,10 @@ describe GroupsHelper do
cross_project_features = [:activity, :issues, :labels, :milestones,
:merge_requests]
- expect(helper).to receive(:can?).with(user, :read_cross_project) { false }
+ allow(Ability).to receive(:allowed?).and_call_original
+ cross_project_features.each do |feature|
+ expect(Ability).to receive(:allowed?).with(user, "read_group_#{feature}".to_sym, group) { false }
+ end
expect(helper.group_sidebar_links).not_to include(*cross_project_features)
end