diff options
author | Robert Speicher <robert@gitlab.com> | 2016-08-11 16:52:49 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-08-11 16:52:49 +0000 |
commit | ded60291863d3c7cbf5bc9725c5b0a6ae9110ffa (patch) | |
tree | ac9e05d71b0a6b66520212eb832c4bcc09426790 /spec | |
parent | 5a33bc984abfb4ee6243c00bbcc71ccd086d2266 (diff) | |
parent | 32b579e8426094af4b7731d3e91597a377a7ba7e (diff) | |
download | gitlab-ce-ded60291863d3c7cbf5bc9725c5b0a6ae9110ffa.tar.gz |
Merge branch '20614-show-member-roles-to-all-users' into 'master'
Show member roles to all users on members page
Closes #20614 and https://gitlab.com/gitlab-org/gitlab-ee/issues/850
See merge request !5776
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/members_helper_spec.rb | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/spec/helpers/members_helper_spec.rb b/spec/helpers/members_helper_spec.rb index f75fdb739f6..7998209b7b0 100644 --- a/spec/helpers/members_helper_spec.rb +++ b/spec/helpers/members_helper_spec.rb @@ -9,54 +9,6 @@ describe MembersHelper do it { expect(action_member_permission(:admin, group_member)).to eq :admin_group_member } end - describe '#default_show_roles' do - let(:user) { double } - let(:member) { build(:project_member) } - - before do - allow(helper).to receive(:current_user).and_return(user) - allow(helper).to receive(:can?).with(user, :update_project_member, member).and_return(false) - allow(helper).to receive(:can?).with(user, :destroy_project_member, member).and_return(false) - allow(helper).to receive(:can?).with(user, :admin_project_member, member.source).and_return(false) - end - - context 'when the current cannot update, destroy or admin the passed member' do - it 'returns false' do - expect(helper.default_show_roles(member)).to be_falsy - end - end - - context 'when the current can update the passed member' do - before do - allow(helper).to receive(:can?).with(user, :update_project_member, member).and_return(true) - end - - it 'returns true' do - expect(helper.default_show_roles(member)).to be_truthy - end - end - - context 'when the current can destroy the passed member' do - before do - allow(helper).to receive(:can?).with(user, :destroy_project_member, member).and_return(true) - end - - it 'returns true' do - expect(helper.default_show_roles(member)).to be_truthy - end - end - - context 'when the current can admin the passed member source' do - before do - allow(helper).to receive(:can?).with(user, :admin_project_member, member.source).and_return(true) - end - - it 'returns true' do - expect(helper.default_show_roles(member)).to be_truthy - end - end - end - describe '#remove_member_message' do let(:requester) { build(:user) } let(:project) { create(:project) } |