Files
gitlabhq/features/steps/shared/authentication.rb
Jason Hollingsworth c099074fcc Fix 404 on project page for unauthenticated user
Eliminate a 404 error when user is not logged in and attempts to visit
a project page.

The 404 page will still show up when user is logged in and the project
doesn’t exist or the user doesn’t have access.
2013-12-04 13:10:20 -06:00

23 lines
417 B
Ruby

require Rails.root.join('spec', 'support', 'login_helpers')
module SharedAuthentication
include Spinach::DSL
include LoginHelpers
Given 'I sign in as a user' do
login_as :user
end
Given 'I sign in as an admin' do
login_as :admin
end
step 'I should be redirected to sign in page' do
current_path.should == new_user_session_path
end
def current_user
@user || User.first
end
end