diff options
Diffstat (limited to 'spec/controllers/projects/alert_management_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/alert_management_controller_spec.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/controllers/projects/alert_management_controller_spec.rb b/spec/controllers/projects/alert_management_controller_spec.rb index ccb9bfc3001..31185aa948a 100644 --- a/spec/controllers/projects/alert_management_controller_spec.rb +++ b/spec/controllers/projects/alert_management_controller_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' describe Projects::AlertManagementController do let_it_be(:project) { create(:project) } - let_it_be(:role) { :reporter } + let_it_be(:role) { :developer } let_it_be(:user) { create(:user) } let_it_be(:id) { 1 } @@ -24,6 +24,16 @@ describe Projects::AlertManagementController do expect(response).to have_gitlab_http_status(:ok) end + + context 'when user is unauthorized' do + let(:role) { :reporter } + + it 'shows 404' do + get :index, params: { namespace_id: project.namespace, project_id: project } + + expect(response).to have_gitlab_http_status(:not_found) + end + end end context 'when alert_management_minimal is disabled' do @@ -50,6 +60,16 @@ describe Projects::AlertManagementController do expect(response).to have_gitlab_http_status(:ok) end + + context 'when user is unauthorized' do + let(:role) { :reporter } + + it 'shows 404' do + get :index, params: { namespace_id: project.namespace, project_id: project } + + expect(response).to have_gitlab_http_status(:not_found) + end + end end context 'when alert_management_detail is disabled' do |