daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Jul 14th, 2015 203 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   before('init', function (done) {
  2.  
  3.     this.timeout(5000);
  4.  
  5.     async.auto({
  6.       abc: function(){
  7.         console.log('HERE!!!');
  8.       },
  9.       reset: utils.resetDb,
  10.       testUser: ['reset', accountUtils.createUserAndProfile.bind(null, testUserData)],
  11.       otherUser: ['reset', accountUtils.createUserAndProfile.bind(null, otherUserData)],
  12.       company: ['reset',
  13.         function (callback, results) {
  14.           CompanyModel.create(workData[0].at).exec(callback)
  15.         }
  16.       ],
  17.       work: ['testUser', 'company',
  18.         function (callback, results) {
  19.           WorkModel.create(_.extend(_.clone(workData[0]), {
  20.             at: results.company.id,
  21.             profile: results.testUser[1].id
  22.           })).exec(callback);
  23.         }
  24.       ]
  25.     }, function (err, results) {
  26.       if (err)
  27.         return done(err);
  28.       testUser = results.testUser[0];
  29.       testUserProfile = results.testUser[1];
  30.       otherUser = results.otherUser[0];
  31.       otherProfile = results.otherUser[1];
  32.       company = results.company;
  33.       work = results.work;
  34.       done(err, results);
  35.     });
  36.  
  37.   });
RAW Paste Data
Top