summaryrefslogtreecommitdiff
path: root/spec/controllers/ci
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-24 14:16:12 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-03-29 08:04:17 +0200
commitb7685b57d3fc9a2e27096c5984d92fd104ff71b7 (patch)
tree210f45973253ec0f451f8ad34ca07f7c55ba5e44 /spec/controllers/ci
parent6f894bec097a4cfa378cee908d81f3cba67a09e5 (diff)
downloadgitlab-ce-b7685b57d3fc9a2e27096c5984d92fd104ff71b7.tar.gz
Redirect to root path when visiting `/ci`fix/nomethod-error-on-ci
Diffstat (limited to 'spec/controllers/ci')
-rw-r--r--spec/controllers/ci/projects_controller_spec.rb21
1 files changed, 16 insertions, 5 deletions
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