diff options
author | Earth <Earth@BlueSky> | 2016-11-13 02:59:43 +0300 |
---|---|---|
committer | Earth <Earth@BlueSky> | 2016-11-13 02:59:43 +0300 |
commit | f080cb53160d7354fde017aabb834ab7d80bf574 (patch) | |
tree | 4f6362237aa7fe41a9498afb7177a23a77cc0d5a | |
parent | 4b7288f19fb76f103b802ccfde848fb0a6ebc543 (diff) | |
download | gitlab-ce-f080cb53160d7354fde017aabb834ab7d80bf574.tar.gz |
Add a unit test for redirecting to sign-in page when user is not logged in and user visits the new fork page
-rw-r--r-- | spec/controllers/projects/forks_controller_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/controllers/projects/forks_controller_spec.rb b/spec/controllers/projects/forks_controller_spec.rb index ac3469cb8a9..11ae425a76e 100644 --- a/spec/controllers/projects/forks_controller_spec.rb +++ b/spec/controllers/projects/forks_controller_spec.rb @@ -67,4 +67,19 @@ describe Projects::ForksController do end end end + + describe 'GET new' do + context 'when user is not logged in' do + + it 'redirects to the sign-in page' do + sign_out(user) + + get :new, + namespace_id: project.namespace.to_param, + project_id: project.to_param + + expect(response).to redirect_to(root_path + 'users/sign_in') + end + end + end end |