-
-
Save ChrisC/8345530 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| it('should set the offer to accepted when a carrier accepts on a drivers behalf', function (done){ | |
| new StateImporter('offers', 'accept', function () { | |
| models.user.findOne({_type : 'Driver'}, function (driver) { | |
| models.offer.findOne({}, function (offer) { | |
| var accept_offer = function (callback) { | |
| request.put('/api/1/offers/accept') | |
| .send({driver_id : driver._id, offer_id : offer._id, accept : 'true', by_proxy : 'true'}) | |
| .end(function(err, res) { | |
| callback(null, res.body.jobs); | |
| }); | |
| }; | |
| async.parallel([accept_offer, accept_offer], function (err, result) { | |
| _.compact(result).should.have.lengthOf(1); | |
| done(); | |
| } ); | |
| }); | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment