2016-05-14 19:23:31 -04:00
|
|
|
describe JSONWebToken::Token do
|
2016-05-09 15:06:32 -04:00
|
|
|
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
|