diff options
author | Mario de la Ossa <mariodelaossa@gmail.com> | 2019-01-17 20:40:37 +0300 |
---|---|---|
committer | Mario de la Ossa <mariodelaossa@gmail.com> | 2019-01-18 21:43:46 +0300 |
commit | 54994762ffd45e55cc9c000fbfb382382c69ad5d (patch) | |
tree | 1613e95fcae03b3ee8e4ad99be7b2bfefccd4023 /spec/controllers/boards/issues_controller_spec.rb | |
parent | c46b8e968ba926745418738cb8855f0ca23b97cd (diff) |
Backport of 54385-board-policy
Diffstat (limited to 'spec/controllers/boards/issues_controller_spec.rb')
-rw-r--r-- | spec/controllers/boards/issues_controller_spec.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/spec/controllers/boards/issues_controller_spec.rb b/spec/controllers/boards/issues_controller_spec.rb index 8657fc2ebc0..725ea2bf1ab 100644 --- a/spec/controllers/boards/issues_controller_spec.rb +++ b/spec/controllers/boards/issues_controller_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Boards::IssuesController do - let(:project) { create(:project) } + let(:project) { create(:project, :private) } let(:board) { create(:board, project: project) } let(:user) { create(:user) } let(:guest) { create(:user) } @@ -127,14 +127,10 @@ describe Boards::IssuesController do end context 'with unauthorized user' do - before do - allow(Ability).to receive(:allowed?).and_call_original - allow(Ability).to receive(:allowed?).with(user, :read_project, project).and_return(true) - allow(Ability).to receive(:allowed?).with(user, :read_issue, project).and_return(false) - end + let(:unauth_user) { create(:user) } it 'returns a forbidden 403 response' do - list_issues user: user, board: board, list: list2 + list_issues user: unauth_user, board: board, list: list2 expect(response).to have_gitlab_http_status(403) end |