-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added fetch api for one off job requests
- Loading branch information
Showing
3 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
var assert = require('chai').assert; | ||
var helper = require('./testHelper'); | ||
|
||
describe('fetch', function(){ | ||
|
||
var boss; | ||
|
||
before(function(finished){ | ||
helper.start() | ||
.then(dabauce => { | ||
boss = dabauce; | ||
finished(); | ||
}); | ||
}); | ||
|
||
after(function(finished){ | ||
boss.stop().then(() => finished()); | ||
}); | ||
|
||
it('should fetch a single job by name and manually complete', function(finished) { | ||
var jobName = 'no-subscribe-required'; | ||
|
||
boss.publish(jobName) | ||
.then(() => boss.fetch(jobName)) | ||
.then(job => { | ||
assert(jobName === job.name); | ||
return boss.complete(job.id); | ||
}) | ||
.then(() => { | ||
assert(true); | ||
finished(); | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
|
||
|