Sha256: eb2ffc811063eaa30982d0b7483c60f613840b8793a80f372abe4b034ad7e0a2

Contents?: true

Size: 506 Bytes

Versions: 2

Compression:

Stored size: 506 Bytes

Contents

require 'spec_helper'
require 'authenticate/model/timeoutable'

describe Authenticate::Model::Timeoutable do
  subject { create(:user) }

  it 'does not timeout while last_access_at is valid' do
    Timecop.freeze do
      subject.last_access_at = 10.minutes.ago
      expect(subject.timedout?).to be_falsey
    end
  end

  it 'does timeout when last_access_at is stale' do
    Timecop.freeze do
      subject.last_access_at = 46.minutes.ago
      expect(subject.timedout?).to be_truthy
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
authenticate-0.3.3 spec/model/timeoutable_spec.rb
authenticate-0.3.2 spec/model/timeoutable_spec.rb