2012-09-10 11:35:03 -04: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
|
2012-09-25 20:11:57 -04:00
|
|
|
|
|
|
|
Given 'I sign in as an admin' do
|
|
|
|
login_as :admin
|
|
|
|
end
|
2012-09-27 16:23:11 -04:00
|
|
|
|
|
|
|
def current_user
|
|
|
|
@user || User.first
|
|
|
|
end
|
2012-09-10 11:35:03 -04:00
|
|
|
end
|