gitlab-org--gitlab-foss/features/steps/shared/authentication.rb

23 lines
417 B
Ruby
Raw Normal View History

2012-09-10 15:35:03 +00:00
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
2012-09-27 20:23:11 +00:00
step 'I should be redirected to sign in page' do
current_path.should == new_user_session_path
end
2012-09-27 20:23:11 +00:00
def current_user
@user || User.first
end
2012-09-10 15:35:03 +00:00
end