Commit f080cb53 authored by Earth's avatar Earth

Add a unit test for redirecting to sign-in page when user is not logged in and...

Add a unit test for redirecting to sign-in page when user is not logged in and user visits the new fork page
parent 4b7288f1
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment