diff options
Diffstat (limited to 'spec/controllers/projects/alert_management_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/alert_management_controller_spec.rb | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/spec/controllers/projects/alert_management_controller_spec.rb b/spec/controllers/projects/alert_management_controller_spec.rb deleted file mode 100644 index d80147b5c59..00000000000 --- a/spec/controllers/projects/alert_management_controller_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Projects::AlertManagementController do - let_it_be(:project) { create(:project) } - let_it_be(:role) { :developer } - let_it_be(:user) { create(:user) } - let_it_be(:id) { 1 } - - before do - project.add_role(user, role) - sign_in(user) - end - - describe 'GET #index' do - it 'shows the page' do - get :index, params: { namespace_id: project.namespace, project_id: project } - - 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 - - describe 'GET #details' do - it 'shows the page' do - get :details, params: { namespace_id: project.namespace, project_id: project, id: id } - - expect(response).to have_gitlab_http_status(:ok) - end - - context 'when user is unauthorized' do - let(:role) { :reporter } - - it 'shows 404' do - get :details, params: { namespace_id: project.namespace, project_id: project, id: id } - - expect(response).to have_gitlab_http_status(:not_found) - end - end - end - - describe 'set_alert_id' do - it 'sets alert id from the route' do - get :details, params: { namespace_id: project.namespace, project_id: project, id: id } - - expect(assigns(:alert_id)).to eq(id.to_s) - end - end -end |