15 lines
315 B
Ruby
15 lines
315 B
Ruby
|
|
module SessionHelper
|
|
|
|
def login(nick=nil, password=nil)
|
|
visit login_path
|
|
if nick.nil?
|
|
user = FactoryGirl.create :user
|
|
nick, password = user.nick, user.password
|
|
end
|
|
fill_in 'nick', :with => nick
|
|
fill_in 'password', :with => password
|
|
find('input[type=submit]').click
|
|
end
|
|
|
|
end
|