summaryrefslogtreecommitdiff
path: root/spec/lib/json_web_token/token_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/json_web_token/token_spec.rb')
-rw-r--r--spec/lib/json_web_token/token_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/lib/json_web_token/token_spec.rb b/spec/lib/json_web_token/token_spec.rb
new file mode 100644
index 00000000000..3d955e4d774
--- /dev/null
+++ b/spec/lib/json_web_token/token_spec.rb
@@ -0,0 +1,18 @@
+describe JSONWebToken::Token do
+ 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