From 896e496f83c92fb0326dceb56a0fcf007e7327da Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Sun, 9 Oct 2011 16:48:18 +0200 Subject: [PATCH] FIx failing test due to refactoring of code --- features/step_definitions/user_steps.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index f11586cb..4af46a87 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -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