diff --git a/ee/spec/controllers/admin/dashboard_controller_spec.rb b/ee/spec/controllers/admin/dashboard_controller_spec.rb new file mode 100644 index 0000000000000000000000000000000000000000..562424f795287dbccc13df1f0c1d78a0e1333417 --- /dev/null +++ b/ee/spec/controllers/admin/dashboard_controller_spec.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe Admin::DashboardController do + describe '#index' do + it "allows an admin user to access the page" do + sign_in(create(:user, :admin)) + + get :index + + expect(response).to have_gitlab_http_status(200) + end + + it "does not allow an auditor user to access the page" do + sign_in(create(:user, :auditor)) + + get :index + + expect(response).to have_gitlab_http_status(404) + end + + it "does not allow a regular user to access the page" do + sign_in(create(:user)) + + get :index + + expect(response).to have_gitlab_http_status(404) + end + end +end diff --git a/spec/controllers/admin/dashboard_controller_spec.rb b/spec/controllers/admin/dashboard_controller_spec.rb index dcb93137e18badca38cabf3d83e586a67aa43b22..4de69a9aea1ef0d9999a4e442e178da003a05c96 100644 --- a/spec/controllers/admin/dashboard_controller_spec.rb +++ b/spec/controllers/admin/dashboard_controller_spec.rb @@ -4,27 +4,6 @@ require 'spec_helper' describe Admin::DashboardController do describe '#index' do - it "allows an admin user to access the page" do - sign_in(create(:user, :admin)) - get :index - - expect(response).to have_gitlab_http_status(200) - end - - it "does not allow an auditor user to access the page" do - sign_in(create(:user, :auditor)) - get :index - - expect(response).to have_gitlab_http_status(404) - end - - it "does not allow a regular user to access the page" do - sign_in(create(:user)) - get :index - - expect(response).to have_gitlab_http_status(404) - end - context 'with pending_delete projects' do render_views