2014-01-27 09:53:59 -05:00
|
|
|
module SharedUser
|
|
|
|
include Spinach::DSL
|
|
|
|
|
2014-02-07 11:59:55 -05:00
|
|
|
step 'User "John Doe" exists' do
|
|
|
|
user_exists("John Doe", {username: "john_doe"})
|
2014-01-27 09:53:59 -05:00
|
|
|
end
|
|
|
|
|
2014-02-07 11:59:55 -05:00
|
|
|
step 'User "Mary Jane" exists' do
|
|
|
|
user_exists("Mary Jane", {username: "mary_jane"})
|
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def user_exists(name, options = {})
|
|
|
|
User.find_by(name: name) || create(:user, {name: name, admin: false}.merge(options))
|
2014-01-27 09:53:59 -05:00
|
|
|
end
|
|
|
|
end
|