FIx failing test due to refactoring of code

This commit is contained in:
Stefan Richter 2011-10-09 16:48:18 +02:00
parent 5f5a2045b5
commit 896e496f83

View file

@ -22,10 +22,10 @@ Given /^the following user records with hash algorithm$/ do |table|
BCrypt::Password.new(user.crypted_password).should == password
when 'sha1'
user.password = user.password_confirmation = nil
user.write_attribute :crypted_password, User.sha1( password )
user.write_attribute :crypted_password, Digest::SHA1.hexdigest("#{Tracks::Config.salt}--#{password}--")
user.save
user.reload
user.crypted_password.should == User.sha1(password)
user.crypted_password.should == Digest::SHA1.hexdigest("#{Tracks::Config.salt}--#{password}--")
else
raise "Unknown hashing algorithm: #{algorithm}"
end