From 50d7c356c2d1622203b518bf0f3d5cbf1860099a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 5 Dec 2017 15:03:16 +0100 Subject: Present member collection at the controller level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- spec/presenters/group_member_presenter_spec.rb | 2 ++ spec/presenters/project_member_presenter_spec.rb | 2 ++ 2 files changed, 4 insertions(+) (limited to 'spec/presenters') diff --git a/spec/presenters/group_member_presenter_spec.rb b/spec/presenters/group_member_presenter_spec.rb index 05a6dee3196..c00e41725d9 100644 --- a/spec/presenters/group_member_presenter_spec.rb +++ b/spec/presenters/group_member_presenter_spec.rb @@ -64,6 +64,7 @@ describe GroupMemberPresenter do context 'when user cannot update_group_member' do before do allow(presenter).to receive(:can?).with(user, :update_group_member, presenter).and_return(false) + allow(presenter).to receive(:can?).with(user, :override_group_member, presenter).and_return(false) end it { expect(presenter.can_update?).to eq(false) } @@ -105,6 +106,7 @@ describe GroupMemberPresenter do context 'when user cannot update_group_member' do before do allow(presenter).to receive(:can?).with(user, :update_group_member, presenter).and_return(false) + allow(presenter).to receive(:can?).with(user, :override_group_member, presenter).and_return(false) end it { expect(presenter.can_approve?).to eq(false) } diff --git a/spec/presenters/project_member_presenter_spec.rb b/spec/presenters/project_member_presenter_spec.rb index eb93f03a958..83db5c56cdf 100644 --- a/spec/presenters/project_member_presenter_spec.rb +++ b/spec/presenters/project_member_presenter_spec.rb @@ -64,6 +64,7 @@ describe ProjectMemberPresenter do context 'when user cannot update_project_member' do before do allow(presenter).to receive(:can?).with(user, :update_project_member, presenter).and_return(false) + allow(presenter).to receive(:can?).with(user, :override_project_member, presenter).and_return(false) end it { expect(presenter.can_update?).to eq(false) } @@ -105,6 +106,7 @@ describe ProjectMemberPresenter do context 'and user cannot update_project_member' do before do allow(presenter).to receive(:can?).with(user, :update_project_member, presenter).and_return(false) + allow(presenter).to receive(:can?).with(user, :override_project_member, presenter).and_return(false) end it { expect(presenter.can_approve?).to eq(false) } -- cgit v1.2.1