Files
gitlabhq/features/steps/shared/authentication.rb
T
Dmitriy Zaporozhets 89ac4f1d56 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ce-to-ee
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	features/steps/project/project.rb
2015-06-12 14:01:20 +02:00

39 lines
715 B
Ruby

require Rails.root.join('spec', 'support', 'login_helpers')
module SharedAuthentication
include Spinach::DSL
include LoginHelpers
step 'I sign in as a user' do
login_as :user
end
step 'I sign in as an admin' do
login_as :admin
end
step 'I sign in as "John Doe"' do
login_with(user_exists("John Doe"))
end
step 'I sign in as "Mary Jane"' do
login_with(user_exists("Mary Jane"))
end
step 'I sign in as "Pete Peters"' do
login_with(user_exists("Pete Peters"))
end
step 'I should be redirected to sign in page' do
expect(current_path).to eq new_user_session_path
end
step "I logout" do
logout
end
def current_user
@user || User.first
end
end