开发者

ArgumentError: wrong # of arguments(0 for 1) Rails Unit Testing

the error says "ArgumentError: wrong # of arguments(0 for 1)" for:

def test_auth
  #check that we can login we a valid Usuario
  assert_equal  @bob, Usuario.autenticar("bob", "test")
end

But, autenticar DOES take 2 arguments:

def self.autenticar(usuario, clave)
  u=find(:firs开发者_如何学Got, :conditions=>["usuario = ?", usuario])
  return nil if u.nil?
  return u if Usuario.encrypt(clave, u.salt)==u.clave
  nil
end

Whats happening?


As noted in the comments section, the method clave within autenticar expected an argument and didn't get one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜