Topic: Unit Testing
All i need a help for unit/testing, anyone give me the url of complete book of testing in ror.
I got the code from google but i need code sample with explination.here my problem is that, i am trying to write the code for testing are below
def self.authenticate(username, password)
contact = Contact.find(:first, :conditions => ['username = ?', username])
if ( contact.blank? || contact == nil || (Digest::SHA256.hexdigest(password + contact.password_salt) != contact.password_hash) )
raise "Username or password invalid in model" # This will raise an exception if the above comparison condition fails
can any one make me a reply for this,with explination if possible.