Update request, make server tests work with it

This commit is contained in:
Scott Erickson 2016-03-03 16:06:49 -08:00
parent eeb6f8c5e9
commit e1e5b66d7f
10 changed files with 2 additions and 11 deletions

View file

@ -78,7 +78,7 @@
"passport": "0.1.x",
"passport-local": "0.1.x",
"redis": "",
"request": "2.12.x",
"request": "^2.69.0",
"sendwithus": "2.1.x",
"stream-buffers": "0.2.x",
"stripe": "~2.9.0",

View file

@ -77,7 +77,6 @@ beforeEach(function(done) {
},
function(cb) {
// Initialize products
var request = require('request');
request.get(getURL('/db/products'), function(err, res, body) {
expect(err).toBe(null);
expect(res.statusCode).toBe(200);

View file

@ -70,7 +70,7 @@ GLOBAL.saveModels = (models, done) ->
GLOBAL.simplePermissions = [target: 'public', access: 'owner']
GLOBAL.ObjectId = mongoose.Types.ObjectId
GLOBAL.request = require 'request'
GLOBAL.request = require('request').defaults({jar: true})
Promise = require 'bluebird'
Promise.promisifyAll(request, {multiArgs: true})
@ -88,7 +88,6 @@ unittest.getUser = (name, email, password, done, force) ->
# Creates the user if it doesn't already exist.
return done(unittest.users[email]) if unittest.users[email] and not force
request = require 'request'
request.post getURL('/auth/logout'), ->
request.get getURL('/auth/whoami'), ->
req = request.post(getURL('/db/user'), (err, response, body) ->

View file

@ -1,5 +1,4 @@
require '../common'
request = require 'request'
User = require '../../../server/users/User'
urlLogin = getURL('/auth/login')

View file

@ -1,7 +1,6 @@
require '../common'
describe '/db/<id>/version', ->
request = require 'request'
it 'clears the db first', (done) ->
clearModels [User, Article], (err) ->
throw err if err

View file

@ -1,4 +1,3 @@
request = require 'request'
require '../common'
config = require '../../../server_config'
nockUtils = require('../nock-utils')

View file

@ -1,7 +1,6 @@
require '../common'
describe '/db/patch', ->
request = require 'request'
async = require 'async'
UserHandler = require '../../../server/users/user_handler'

View file

@ -6,7 +6,6 @@ nockUtils = require '../nock-utils'
describe '/db/payment', ->
request = require 'request'
paymentURL = getURL('/db/payment')
checkChargesURL = getURL('/db/payment/check-stripe-charges')
customPaymentURL = getURL('/db/payment/custom')

View file

@ -1,5 +1,4 @@
require '../common'
request = require 'request'
User = require '../../../server/users/User'
urlUser = '/db/user'

View file

@ -1,7 +1,6 @@
GLOBAL._ = require 'lodash'
require '../common'
request = require 'request'
AnalyticsUsersActive = require '../../../server/analytics/AnalyticsUsersActive'
LevelSession = require '../../../server/levels/sessions/LevelSession'
User = require '../../../server/users/User'