Sha256: 8779a3412b1b41ff1d4212a1affbbbc37ea81b127ec23056c7b2a9c0ff691f02

Contents?: true

Size: 631 Bytes

Versions: 15

Compression:

Stored size: 631 Bytes

Contents

# -*- encoding : utf-8 -*-

describe Card::Set::Right::Token do
  before do
    @token = Card['Anonymous+*account'].fetch trait: :token, new: {}
  end

  it 'should get expiration from configuration by default' do
    expect(@token.term).to eq(Card.config.token_expiry)
  end

  it 'should get expiration from card if it exists' do
    @token.expiration = '3 days'
    expect(@token.term).to eq(3.days)
    expect(@token.permanent?).to be false
  end

  it 'should be permanent if expiration is "none"' do
    @token.expiration = 'none'
    expect(@token.term).to eq('permanent')
    expect(@token.permanent?).to be true
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
card-1.18.6 mod/05_standard/spec/set/right/token_spec.rb
card-1.18.5 mod/05_standard/spec/set/right/token_spec.rb
card-1.18.4 mod/05_standard/spec/set/right/token_spec.rb
card-1.18.3 mod/05_standard/spec/set/right/token_spec.rb
card-1.18.2 mod/05_standard/spec/set/right/token_spec.rb
card-1.18.1 mod/05_standard/spec/set/right/token_spec.rb
card-1.18.0 mod/05_standard/spec/set/right/token_spec.rb
card-1.17.4 mod/05_standard/spec/set/right/token_spec.rb
card-1.17.3 mod/05_standard/spec/set/right/token_spec.rb
card-1.17.2 mod/05_standard/spec/set/right/token_spec.rb
card-1.17.1 mod/05_standard/spec/set/right/token_spec.rb
card-1.17.0 mod/05_standard/spec/set/right/token_spec.rb
card-1.16.15 mod/05_standard/spec/set/right/token_spec.rb
card-1.16.14 mod/05_standard/spec/set/right/token_spec.rb
card-1.16.13 mod/05_standard/spec/set/right/token_spec.rb