Skip to content

Commit

Permalink
Clarify test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Feb 3, 2016
1 parent 900effe commit 2130fa6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/strategy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ describe('Strategy', function() {
.req(function(req) {
req.session = {};
})
.authenticate({ hostedDomain: 'example.com' });
.authenticate({ hostedDomain: 'mycollege.edu' });
});

it('should be redirected', function() {
expect(url).to.equal('https://accounts.google.com/o/oauth2/v2/auth?hd=example.com&response_type=code&redirect_uri=&client_id=ABC123');
expect(url).to.equal('https://accounts.google.com/o/oauth2/v2/auth?hd=mycollege.edu&response_type=code&redirect_uri=&client_id=ABC123');
});
}); // authorization request with Google Apps for Work parameters

Expand All @@ -148,11 +148,11 @@ describe('Strategy', function() {
.req(function(req) {
req.session = {};
})
.authenticate({ hd: 'example.com' });
.authenticate({ hd: 'mycollege.edu' });
});

it('should be redirected', function() {
expect(url).to.equal('https://accounts.google.com/o/oauth2/v2/auth?hd=example.com&response_type=code&redirect_uri=&client_id=ABC123');
expect(url).to.equal('https://accounts.google.com/o/oauth2/v2/auth?hd=mycollege.edu&response_type=code&redirect_uri=&client_id=ABC123');
});
}); // authorization request with Google Apps for Work parameters, in abbreviated form

Expand Down Expand Up @@ -226,11 +226,11 @@ describe('Strategy', function() {
.req(function(req) {
req.session = {};
})
.authenticate({ approvalPrompt: 'none', userID: '1' });
.authenticate({ approvalPrompt: 'force', userID: 'bob@gmail.com' });
});

it('should be redirected', function() {
expect(url).to.equal('https://accounts.google.com/o/oauth2/v2/auth?approval_prompt=none&user_id=1&response_type=code&redirect_uri=&client_id=ABC123');
expect(url).to.equal('https://accounts.google.com/o/oauth2/v2/auth?approval_prompt=force&user_id=bob%40gmail.com&response_type=code&redirect_uri=&client_id=ABC123');
});
}); // authorization request with undocumented parameters

Expand Down

0 comments on commit 2130fa6

Please sign in to comment.