spec/acceptance/rest/auth_spec.rb in ably-0.7.4 vs spec/acceptance/rest/auth_spec.rb in ably-0.7.5

- old
+ new

@@ -326,9 +326,30 @@ expect(request_token.expires_at).to be_within(1).of(expires) expect(request_token.issued_at).to be_within(1).of(issued_at) expect(request_token.capability.to_json).to eql(capability.to_json) end end + + context 'persisted option', api_private: true do + context 'when set to true', api_private: true do + let(:options) { { persisted: true } } + let(:token) { auth.request_token(options) } + + it 'returns a token with a short token ID that is used to look up the token details' do + expect(token.id.length).to be < 64 + expect(token.id).to match(/^#{app_id}\.A/) + end + end + + context 'when omitted', api_private: true do + let(:options) { { } } + let(:token) { auth.request_token(options) } + + it 'returns a literal token' do + expect(token.id.length).to be > 64 + end + end + end end context 'before #authorise has been called' do it 'has no current_token' do expect(auth.current_token).to be_nil