make integration spec work with javascript driver too

This commit is contained in:
wvengen 2013-07-24 02:57:45 +02:00
parent a858ceedea
commit 0d33922ed9
4 changed files with 33 additions and 2 deletions

View file

@ -4,7 +4,11 @@ module SessionHelper
def login(user=nil, password=nil)
visit login_path
user = FactoryGirl.create :user if user.nil?
nick, password = user.nick, user.password if user.instance_of? ::User
if user.instance_of? ::User
nick, password = user.nick, user.password
else
nick = user
end
fill_in 'nick', :with => nick
fill_in 'password', :with => password
find('input[type=submit]').click