Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Commit

Permalink
Add test to confirm mode (sandbox/live) toggling for logout_url and
Browse files Browse the repository at this point in the history
authorize_url for openid_connect
  • Loading branch information
avidas committed Jun 23, 2014
1 parent d7090d7 commit 18ec527
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/openid_connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('OpenIDConnect', function () {
expect(url).to.contain('scope=openid');
expect(url).to.contain('client_id=');
expect(url).to.contain('redirect_uri=');
expect(url).to.contain('www.sandbox.paypal.com');
done();
});

Expand All @@ -39,6 +40,15 @@ describe('OpenIDConnect', function () {
expect(url).to.contain(querystring.stringify({'scope': 'openid profile'}));
done();
});

it('with live mode', function (done) {
paypal_sdk.configure({
'mode': 'live'
});
var url = openid_connect.authorize_url({'scope': 'openid profile'});
expect(url).to.not.contain('sandbox');
expect(url).to.contain('www.paypal.com');
});
});

describe('logout_url', function () {
Expand All @@ -54,6 +64,16 @@ describe('OpenIDConnect', function () {
expect(url).to.contain('id_token=test');
done();
});

it('with live mode', function (done) {
paypal_sdk.configure({
'mode': 'live'
});
var url = openid_connect.logout_url({'id_token': 'test'});
expect(url).to.not.contain('sandbox');
expect(url).to.contain('www.paypal.com');
console.log(url);
});
});

describe('Tokeninfo', function () {
Expand Down

0 comments on commit 18ec527

Please sign in to comment.