summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-06-17 10:23:06 +0200
committerRémy Coutable <remy@rymai.me>2016-06-17 13:03:19 +0200
commitb2dc9176018729efc1969035b30017c2ed81a708 (patch)
tree7a87e5953bc9eca5586364c285e51dace8b23f02 /spec
parentf011b86beb89557afdaf2b0ec5ae904d0be237d8 (diff)
downloadgitlab-ce-b2dc9176018729efc1969035b30017c2ed81a708.tar.gz
Group owner cannot request access to a project of their group
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/members/group_owner_cannot_request_access_to_his_group_project_spec.rb17
-rw-r--r--spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb21
2 files changed, 38 insertions, 0 deletions
diff --git a/spec/features/projects/members/group_owner_cannot_request_access_to_his_group_project_spec.rb b/spec/features/projects/members/group_owner_cannot_request_access_to_his_group_project_spec.rb
new file mode 100644
index 00000000000..c4686ccceff
--- /dev/null
+++ b/spec/features/projects/members/group_owner_cannot_request_access_to_his_group_project_spec.rb
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+feature 'Projects > Members > Group owner cannot request access to his group project', feature: true do
+ let(:owner) { create(:user) }
+ let(:group) { create(:group) }
+ let(:project) { create(:project, namespace: group) }
+
+ background do
+ group.add_owner(owner)
+ login_as(owner)
+ visit namespace_project_path(project.namespace, project)
+ end
+
+ scenario 'owner does not see the request access button' do
+ expect(page).not_to have_content 'Request Access'
+ end
+end
diff --git a/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb b/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb
new file mode 100644
index 00000000000..c4ed92d2780
--- /dev/null
+++ b/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+feature 'Projects > Members > Group requester cannot request access to project', feature: true do
+ let(:user) { create(:user) }
+ let(:owner) { create(:user) }
+ let(:group) { create(:group, :public) }
+ let(:project) { create(:project, :public, namespace: group) }
+
+ background do
+ group.add_owner(owner)
+ login_as(user)
+ visit group_path(group)
+ perform_enqueued_jobs { click_link 'Request Access' }
+ visit namespace_project_path(project.namespace, project)
+ end
+
+ scenario 'group requester does not see the request access / withdraw access request button' do
+ expect(page).not_to have_content 'Request Access'
+ expect(page).not_to have_content 'Withdraw Access Request'
+ end
+end