summaryrefslogtreecommitdiff
path: root/spec/helpers/projects_helper_spec.rb
diff options
context:
space:
mode:
authorLuke Bennett <lbennett@gitlab.com>2019-05-10 23:00:36 +0100
committerLuke Bennett <lbennett@gitlab.com>2019-05-10 23:00:36 +0100
commitfae745c3421efe5793e55e4b29a538277608120c (patch)
tree24e3faba4dc53bf05d0910fd0a8c8002473bc70c /spec/helpers/projects_helper_spec.rb
parent4828ef52edee8d23ce564e9d3fe91bdb187a73e3 (diff)
downloadgitlab-ce-fae745c3421efe5793e55e4b29a538277608120c.tar.gz
Resolve CE/EE diffs in new proj member importnew-proj-member-scb
Part of single codebase changes.
Diffstat (limited to 'spec/helpers/projects_helper_spec.rb')
-rw-r--r--spec/helpers/projects_helper_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb
index 554cb861563..83271aa24a3 100644
--- a/spec/helpers/projects_helper_spec.rb
+++ b/spec/helpers/projects_helper_spec.rb
@@ -799,4 +799,24 @@ describe ProjectsHelper do
it { is_expected.to eq(result) }
end
end
+
+ describe '#can_import_members?' do
+ let(:project) { create(:project) }
+ let(:user) { create(:user) }
+ let(:owner) { project.owner }
+
+ before do
+ helper.instance_variable_set(:@project, project)
+ end
+
+ it 'returns false if user cannot admin_project_member' do
+ allow(helper).to receive(:current_user) { user }
+ expect(helper.can_import_members?).to eq false
+ end
+
+ it 'returns true if user can admin_project_member' do
+ allow(helper).to receive(:current_user) { owner }
+ expect(helper.can_import_members?).to eq true
+ end
+ end
end