summaryrefslogtreecommitdiff
path: root/spec/controllers/ci
diff options
context:
space:
mode:
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