diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml index dbb1cf19..cdd9a914 100644 --- a/spec/fixtures/users.yml +++ b/spec/fixtures/users.yml @@ -1,7 +1,7 @@ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html admin_user: login: admin - crypted_password: <%= BCrypt::Password.create("#{Tracks::Config.salt}--abracadabra--").to_s %> + crypted_password: <%= BCrypt::Password.create("abracadabra") %> token: <%= Digest::SHA1.hexdigest("adminSat Feb 25 17:14:00 GMT 20060.236961325863376") %> is_admin: true first_name: Admin @@ -10,7 +10,7 @@ admin_user: other_user: login: jane - crypted_password: <%= BCrypt::Password.create("#{Tracks::Config.salt}--sesame--").to_s %> + crypted_password: <%= BCrypt::Password.create("sesame") %> token: <%= Digest::SHA1.hexdigest("janeSun Feb 19 14:42:45 GMT 20060.408173979260027") %> is_admin: false first_name: Jane diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 3fd36dfa..035960ad 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -109,7 +109,7 @@ describe User do end it 'authenticates user' do - User.authenticate('simon', 'foobarspam').should == @user + User.authenticate('simon', 'foobarspam').id.should be @user.id end it 'resets password' do @@ -117,12 +117,13 @@ describe User do :password => 'new password', :password_confirmation => 'new password' ) - User.authenticate('simon', 'new password').should == @user + User.authenticate('simon', 'foobarspam').should be_nil + User.authenticate('simon', 'new password').id.should be @user.id end it 'does not rehash password after update of login' do @user.update_attribute(:login, 'foobar') - User.authenticate('foobar', 'foobarspam').should == @user + User.authenticate('foobar', 'foobarspam').id.should be @user.id end it 'sets remember token' do