I have this function in my controller:
def open_id_authentication(openid_url)
authenticate_with_open_id(openid_url, :required => [:nickname,
:email], :optional => [:fullname]) do |result, identity_url,
registration|
if result.successful?
@user = User.find_or_initialize_by_identity_url(identity_url)
if @user.new_record?
@user.login = registration['nickname']
@user.fullname = registration['fullname']
@user.email = registration['email']
@user.save!
@user.activate
end
self.current_user = @user
successful_login
else
failed_login result.message, 'openid'
end
end
end
I tried to make a stub but with no success, maybe because it's a
block. Any hint about that one please?
Thanks in advance
Pat
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users