Permalink
Browse files

update queue tests

  • Loading branch information...
1 parent 0e6e9c6 commit 40d066e34a170392eabd4b681e7611d252521034 @twilson63 committed Jan 18, 2012
Showing with 6 additions and 9 deletions.
  1. +0 −3 lib/index.js
  2. +2 −1 src/plugins/couchdb.coffee
  3. +4 −5 test/queueSpec.coffee
View
@@ -14,9 +14,6 @@
app.configure(function() {
app.use(express.logger());
app.use(express.bodyParser());
- app.set('views', __dirname + '/../views');
- app.register('.jade', jade);
- app.set('view engine', 'jade');
app.use(app.router);
app.use(express.static(__dirname + '/../public'));
return app.use(validJob());
@@ -13,11 +13,12 @@ module.exports =
init: (done) ->
@db = nano.use('cloudq')
- done()
+
# Update views if changed...needs api call???
# @db.get "_design/jobs", (e, b) =>
# design_doc = if b.error == 'not_found' then jobs else _.extend(b, jobs)
# @db.insert design_doc, "_design/jobs", (e, b) -> console.log b
+ done()
attach: (options) ->
# ## enqueue Job
View
@@ -63,15 +63,14 @@ describe 'queue', ->
queue.reserveJob 'foo', (err, resp) ->
resp.klass.should.equal 'foo'
done()
- # it 'should return empty if no jobs', (done) ->
- # queue.reserveJob 'nojob', (err, resp) ->
- # done()
+ # # it 'should return empty if no jobs', (done) ->
+ # # queue.reserveJob 'nojob', (err, resp) ->
+ # # done()
it 'should remove all reserved jobs', (done) ->
queue.removeAll 'bar11', (err, resp) ->
resp.ok.should.equal true
done()
it 'should group jobs', (done) ->
queue.groupJobs (err, resp) ->
- resp.rows.length.should.equal 8
+ resp.rows.length.should.be.above 0
done()
-

0 comments on commit 40d066e

Please sign in to comment.