Skip to content

Commit

Permalink
Remove unnecessary extensions in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Nov 9, 2015
1 parent ee57813 commit 3307575
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions test/http/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
/* jshint expr: true */

var http = require('http')
, Passport = require('../..').Passport
, IncomingMessageExt = require('../../lib/http/request');
, Passport = require('../..').Passport;

require('../../lib/framework/connect').__monkeypatchNode();

Expand All @@ -12,12 +11,6 @@ describe('http.ServerRequest', function() {

describe('prototoype', function() {
var req = new http.IncomingMessage();
req.login = IncomingMessageExt.login;
req.logIn = IncomingMessageExt.logIn;
req.logout = IncomingMessageExt.logout;
req.logOut = IncomingMessageExt.logOut;
req.isAuthenticated = IncomingMessageExt.isAuthenticated;
req.isUnauthenticated = IncomingMessageExt.isUnauthenticated;

it('should be extended with login', function() {
expect(req.login).to.be.an('function');
Expand All @@ -44,7 +37,6 @@ describe('http.ServerRequest', function() {
var passport = new Passport();

var req = new http.IncomingMessage();
req.login = IncomingMessageExt.login;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
Expand Down Expand Up @@ -85,7 +77,6 @@ describe('http.ServerRequest', function() {
passport._userProperty = 'currentUser';

var req = new http.IncomingMessage();
req.login = IncomingMessageExt.login;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
Expand Down Expand Up @@ -129,7 +120,6 @@ describe('http.ServerRequest', function() {
var passport = new Passport();

var req = new http.IncomingMessage();
req.login = IncomingMessageExt.login;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
Expand All @@ -155,7 +145,6 @@ describe('http.ServerRequest', function() {

describe('not establishing a session, without passport.initialize() middleware', function() {
var req = new http.IncomingMessage();
req.login = IncomingMessageExt.login;

var error;

Expand Down Expand Up @@ -191,7 +180,6 @@ describe('http.ServerRequest', function() {
});

var req = new http.IncomingMessage();
req.login = IncomingMessageExt.login;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
Expand Down Expand Up @@ -235,7 +223,6 @@ describe('http.ServerRequest', function() {
passport._userProperty = 'currentUser';

var req = new http.IncomingMessage();
req.login = IncomingMessageExt.login;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
Expand Down Expand Up @@ -282,7 +269,6 @@ describe('http.ServerRequest', function() {
});

var req = new http.IncomingMessage();
req.login = IncomingMessageExt.login;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
Expand Down Expand Up @@ -319,7 +305,6 @@ describe('http.ServerRequest', function() {

describe('establishing a session, without passport.initialize() middleware', function() {
var req = new http.IncomingMessage();
req.login = IncomingMessageExt.login;
var user = { id: '1', username: 'root' };

it('should throw an exception', function() {
Expand All @@ -336,7 +321,6 @@ describe('http.ServerRequest', function() {
});

var req = new http.IncomingMessage();
req.login = IncomingMessageExt.login;
req._passport = {};
req._passport.instance = passport;
req._passport.session = {};
Expand All @@ -359,7 +343,6 @@ describe('http.ServerRequest', function() {
var passport = new Passport();

var req = new http.IncomingMessage();
req.logout = IncomingMessageExt.logout;
req.user = { id: '1', username: 'root' };
req._passport = {};
req._passport.instance = passport;
Expand All @@ -386,7 +369,6 @@ describe('http.ServerRequest', function() {
var passport = new Passport();

var req = new http.IncomingMessage();
req.logout = IncomingMessageExt.logout;
req.currentUser = { id: '1', username: 'root' };
req._passport = {};
req._passport.instance = passport;
Expand All @@ -412,7 +394,6 @@ describe('http.ServerRequest', function() {

describe('existing session, without passport.initialize() middleware', function() {
var req = new http.IncomingMessage();
req.logout = IncomingMessageExt.logout;
req.user = { id: '1', username: 'root' };

req.logout();
Expand Down

0 comments on commit 3307575

Please sign in to comment.