Skip to content

Commit

Permalink
fix(test): fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Jan 30, 2019
1 parent 080eb35 commit e419f81
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function dbCallback (err, db) {
return next()
},
function (next) {
//Start Check Mail
// Start Check Mail
var settingSchema = require('./src/models/setting')
settingSchema.getSetting('mailer:check:enable', function (err, mailCheckEnabled) {
if (err) {
Expand Down
8 changes: 7 additions & 1 deletion src/controllers/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ ticketsController.getByStatus = function (req, res, next) {
status: []
}

var pathname = url.URL(req.url).pathname
var fullUrl = url.format({
protocol: req.protocol,
host: req.get('host'),
pathname: req.originalUrl
})

var pathname = new url.URL(fullUrl).pathname
var arr = pathname.split('/')
var tType = 'new'
var s = 0
Expand Down
5 changes: 4 additions & 1 deletion test/0_database.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-unused-expressions */
/* globals server */
/* globals server socketServer */
var expect = require('chai').expect
var winston = require('winston')
var async = require('async')
Expand Down Expand Up @@ -136,6 +136,8 @@ before(function (done) {
expect(err).to.not.exist
global.server = ws.server

require('../src/socketserver')(ws)

cb()
},
3111
Expand All @@ -154,6 +156,7 @@ after(function (done) {
this.timeout(5000)
mongoose.connection.dropDatabase(function () {
mongoose.connection.close(function () {
socketServer.eventLoop.stop()
server.close()

done()
Expand Down

0 comments on commit e419f81

Please sign in to comment.