diff options
-rw-r--r-- | app/controllers/ci/projects_controller.rb | 4 | ||||
-rw-r--r-- | app/views/ci/projects/index.html.haml | 20 | ||||
-rw-r--r-- | spec/controllers/ci/projects_controller_spec.rb | 21 |
3 files changed, 20 insertions, 25 deletions
diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb index c0e7f434ff5..8bf71a1adbb 100644 --- a/app/controllers/ci/projects_controller.rb +++ b/app/controllers/ci/projects_controller.rb @@ -6,6 +6,10 @@ module Ci skip_before_action :authenticate_user!, only: [:badge] protect_from_forgery + def index + redirect_to root_path + end + def show # Temporary compatibility with CI badges pointing to CI project page redirect_to namespace_project_path(project.namespace, project) diff --git a/app/views/ci/projects/index.html.haml b/app/views/ci/projects/index.html.haml deleted file mode 100644 index 9c2290bc4a5..00000000000 --- a/app/views/ci/projects/index.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -.wiki - %h1 - GitLab CI is now integrated in GitLab UI - %h2 For existing projects - - %p - Check the following pages to find the CI status you're looking for: - - %ul - %li Projects page - shows CI status for each project. - %li Project commits page - show CI status for each commit. - - - - %h2 For new projects - - %p - If you want to enable CI for a new project it is easy as adding - = link_to ".gitlab-ci.yml", "http://doc.gitlab.com/ce/ci/yaml/README.html" - file to your repository diff --git a/spec/controllers/ci/projects_controller_spec.rb b/spec/controllers/ci/projects_controller_spec.rb index 9a886e4c124..5022a3e2c80 100644 --- a/spec/controllers/ci/projects_controller_spec.rb +++ b/spec/controllers/ci/projects_controller_spec.rb @@ -6,12 +6,23 @@ describe Ci::ProjectsController do let(:ci_id) { project.ci_id } describe '#index' do - let(:user) { create(:user) } - before { sign_in(user) } - before { get(:index) } + context 'user signed in' do + before do + sign_in(create(:user)) + get(:index) + end + + it 'redirects to /' do + expect(response).to redirect_to(root_path) + end + end + + context 'user not signed in' do + before { get(:index) } - it 'returns 200' do - expect(response.status).to eq 200 + it 'redirects to sign in page' do + expect(response).to redirect_to(new_user_session_path) + end end end |