2019-12-04 20:38:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
describe JSONWebToken::Token do
|
|
|
|
let(:token) { described_class.new }
|
|
|
|
|
|
|
|
context 'custom parameters' do
|
|
|
|
let(:value) { 'value' }
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
before do
|
|
|
|
token[:key] = value
|
|
|
|
end
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
it { expect(token[:key]).to eq(value) }
|
|
|
|
it { expect(token.payload).to include(key: value) }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'embeds default payload' do
|
|
|
|
subject { token.payload }
|
2019-12-21 20:55:43 +05:30
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
let(:default) { token.send(:default_payload) }
|
|
|
|
|
|
|
|
it { is_expected.to include(default) }
|
|
|
|
end
|
|
|
|
end
|