fix unit test

This commit is contained in:
jysperm
2014-11-18 11:04:58 +08:00
parent 6eb7dc6895
commit 38b09a191d
3 changed files with 6 additions and 12 deletions

View File

@@ -132,7 +132,7 @@ app.express.get '/', (req, res) ->
app.express.use harp.mount './core/static'
unless module.parent
exports.start = _.once ->
app.express.listen config.web.listen, ->
app.started = true
@@ -143,3 +143,6 @@ unless module.parent
hook.action()
app.logger.log "RootPanel start at #{config.web.listen}"
unless module.parent
exports.start()

View File

@@ -1,7 +1,7 @@
describe 'app', ->
it 'should can startup', ->
@timeout 20000
require '../../app'
require('../../app').start()
it 'should connected to mongodb', (done) ->
async.forever (callback) ->
@@ -12,15 +12,6 @@ describe 'app', ->
, ->
done()
it 'express should be started', (done) ->
async.forever (callback) ->
if app.started
callback true
else
setImmediate callback
, ->
done()
it 'app.libs should be loaded', ->
{_, express, fs, mongoose} = app.libs
_.should.be.ok

View File

@@ -12,7 +12,7 @@
it 'GET /:category/:title', (done) ->
agent.get '/wiki/FAQ/Billing.md'
.expect if config.plugins.wiki.disable_default_wiki then 404 else 200
.expect if config.plugins.wiki?.disable_default_wiki then 404 else 200
.end done
it 'GET /:category/:title when not exist', (done) ->