Sha256: 7dbefb69c500d8f5f1cc02ff29dc7fbb2963b8a8f6589c65b492cea7fc126d20

Contents?: true

Size: 631 Bytes

Versions: 7

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

7 entries across 7 versions & 1 rubygems

Version Path
card-1.19.6 mod/account/spec/set/right/token_spec.rb
card-1.19.5 mod/account/spec/set/right/token_spec.rb
card-1.19.4 mod/account/spec/set/right/token_spec.rb
card-1.19.3 mod/account/spec/set/right/token_spec.rb
card-1.19.2 mod/account/spec/set/right/token_spec.rb
card-1.19.1 mod/account/spec/set/right/token_spec.rb
card-1.19.0 mod/account/spec/set/right/token_spec.rb