diff options
author | Rémy Coutable <remy@rymai.me> | 2016-07-05 14:24:58 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-07-05 14:35:26 +0200 |
commit | 22ba5d8a7f0920f39ba33bdc4af54531ffe40b1e (patch) | |
tree | 2178ba63c281c892c693f214871b32ab2214a50a /spec/helpers | |
parent | aad62735a4643f851047c11eca9eb188d0ef8c77 (diff) | |
download | gitlab-ce-22ba5d8a7f0920f39ba33bdc4af54531ffe40b1e.tar.gz |
New :request_access ability to replace a ugly helper
- Group / project members cannot request access
- Group members cannot request access to a group's project
This addresses an issue where project owners could request access
to their own project, leading to UI inconsistency where their requester
status would replace their owner status.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/members_helper_spec.rb | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/spec/helpers/members_helper_spec.rb b/spec/helpers/members_helper_spec.rb index 7b2155e9a4e..f75fdb739f6 100644 --- a/spec/helpers/members_helper_spec.rb +++ b/spec/helpers/members_helper_spec.rb @@ -57,72 +57,6 @@ describe MembersHelper do end end - describe '#can_see_request_access_button?' do - let(:user) { create(:user) } - let(:group) { create(:group, :public) } - let(:project) { create(:project, :public, group: group) } - - before do - allow(helper).to receive(:current_user).and_return(user) - end - - context 'source is a group' do - context 'current_user is not a member' do - it 'returns true' do - expect(helper.can_see_request_access_button?(group)).to be_truthy - end - end - - context 'current_user is a member' do - it 'returns false' do - group.add_owner(user) - - expect(helper.can_see_request_access_button?(group)).to be_falsy - end - end - - context 'current_user is a requester' do - it 'returns true' do - group.request_access(user) - - expect(helper.can_see_request_access_button?(group)).to be_truthy - end - end - end - - context 'source is a project' do - context 'current_user is not a member' do - it 'returns true' do - expect(helper.can_see_request_access_button?(project)).to be_truthy - end - end - - context 'current_user is a group member' do - it 'returns false' do - group.add_owner(user) - - expect(helper.can_see_request_access_button?(project)).to be_falsy - end - end - - context 'current_user is a group requester' do - it 'returns false' do - group.request_access(user) - - expect(helper.can_see_request_access_button?(project)).to be_falsy - end - end - - context 'current_user is a member' do - it 'returns false' do - project.team << [user, :master] - - expect(helper.can_see_request_access_button?(project)).to be_falsy - end - end - end - end - describe '#remove_member_message' do let(:requester) { build(:user) } let(:project) { create(:project) } |