BigW Consortium Gitlab

token_spec.rb 448 Bytes
Newer Older
1
describe JSONWebToken::Token do
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
  let(:token) { described_class.new }

  context 'custom parameters' do
    let(:value) { 'value' }
    before { token[:key] = value }

    it { expect(token[:key]).to eq(value) }
    it { expect(token.payload).to include(key: value) }
  end

  context 'embeds default payload' do
    subject { token.payload }
    let(:default) { token.send(:default_payload) }

    it { is_expected.to include(default) }
  end
end