1
def self.find_for_database_authentication(warden_conditions)
conditions = warden_conditions.dup
if login = conditions.delete(:login)
where(conditions).where(["lower(username) = :value OR lower(email) = :value", { :value => login.downcase }]).first
else
where(conditions).first
end
end
以上是验证方法,代码来自Model。如何编写用于设计验证方法的Rspec测试
我无法理解如何在此测试方法中将warden_conditions作为参数传递。
你能帮助我如何通过warden_condition作为参数Rspec(单位)Testiong?
感谢