diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-24 14:16:12 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-29 08:04:17 +0200 |
commit | b7685b57d3fc9a2e27096c5984d92fd104ff71b7 (patch) | |
tree | 210f45973253ec0f451f8ad34ca07f7c55ba5e44 | |
parent | 6f894bec097a4cfa378cee908d81f3cba67a09e5 (diff) | |
download | gitlab-ce-fix/nomethod-error-on-ci.tar.gz |
Redirect to root path when visiting `/ci`fix/nomethod-error-on-ci
-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 |