Sha256: 73e4306ec64733ebab644b79d9d180857673a36e67d8499352a0cafd81b757f4

Contents?: true

Size: 591 Bytes

Versions: 10

Compression:

Stored size: 591 Bytes

Contents

require 'spec_helper'

describe Authenticate::User do
  context 'session tokens' do
    it 'generates a new session token' do
      user = create(:user, :with_session_token)
      old_token = user.session_token
      user.generate_session_token
      expect(user.session_token).to_not eq old_token
    end

    it 'saves user when reset_session_token! called' do
      user = create(:user, :with_session_token)
      old_token = user.session_token
      user.reset_session_token!
      new_user = User.find(user.id)
      expect(new_user.session_token).to_not eq old_token
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
authenticate-0.7.3 spec/model/user_spec.rb
authenticate-0.7.2 spec/model/user_spec.rb
authenticate-0.7.1 spec/model/user_spec.rb
authenticate-0.7.0 spec/model/user_spec.rb
authenticate-0.6.1 spec/model/user_spec.rb
authenticate-0.6.0 spec/model/user_spec.rb
authenticate-0.5.0 spec/model/user_spec.rb
authenticate-0.4.0 spec/model/user_spec.rb
authenticate-0.3.3 spec/model/user_spec.rb
authenticate-0.3.2 spec/model/user_spec.rb