@@ -330,172 +330,6 @@ describe('module/storage', function() {
330330 } ) ;
331331 } ) ;
332332
333- describe ( '#getBuildInfo' , function ( ) {
334- describe ( 'with invalid args' , function ( ) {
335- it ( 'should throw with non string id' , function ( ) {
336- assert . throws ( function ( ) {
337- return storage . getBuildInfo ( {
338- project : 'project' ,
339- build : 4
340- } ) ;
341- } ) ;
342- } ) ;
343- } ) ;
344-
345- describe ( 'with valid args' , function ( ) {
346- var projectSettings ;
347-
348- beforeEach ( function ( ) {
349- projectSettings = { } ;
350- } ) ;
351-
352- it ( 'should reject non existent project' , function ( ) {
353- return assert . isRejected ( storage . getBuildInfo ( {
354- project : 'project' ,
355- build : 'foo'
356- } ) ) ;
357- } ) ;
358-
359- it ( 'should reject non existent build' , function ( ) {
360- return storage . createProject ( projectSettings )
361- . then ( function ( project ) {
362- return assert . isRejected ( storage . getBuildInfo ( {
363- project : project . project ,
364- build : 'foo'
365- } ) , / U n k n o w n B u i l d / ) ;
366- } ) ;
367- } ) ;
368-
369- it ( 'should return build info' , function ( ) {
370- var buildOptions = {
371- head : 'head' ,
372- base : 'base' ,
373- numBrowsers : 3
374- } ;
375-
376- var buildId ;
377-
378- return storage . createProject ( projectSettings )
379- . then ( function ( project ) {
380- buildOptions . project = project . project ;
381-
382- return storage . startBuild ( buildOptions ) ;
383- } )
384- . then ( function ( data ) {
385- buildId = data . build ;
386- } )
387- . then ( function ( ) {
388- return storage . getBuildInfo ( {
389- project : buildOptions . project ,
390- build : buildId
391- } ) ;
392- } )
393- . then ( function ( data ) {
394- assert . isObject ( data ) ;
395- assert . isString ( data . build ) ;
396- assert . equal ( data . status , 'pending' ) ;
397- assert . isUndefined ( data . project ) ;
398-
399- delete buildOptions . project ;
400- assert . shallowDeepEqual ( data , buildOptions ) ;
401- } ) ;
402- } ) ;
403- } ) ;
404- } ) ;
405-
406- describe ( '#updateBuildInfo' , function ( ) {
407- var projectId ;
408- var buildId ;
409-
410- beforeEach ( function ( ) {
411- return storage . createProject ( { } )
412- . then ( function ( project ) {
413- projectId = project . project ;
414- } )
415- . then ( function ( ) {
416- var buildOptions = {
417- project : projectId ,
418- head : 'head' ,
419- base : 'base' ,
420- numBrowsers : 3
421- } ;
422-
423- return storage . startBuild ( buildOptions ) ;
424- } )
425- . then ( function ( data ) {
426- buildId = data . build ;
427- } ) ;
428- } ) ;
429-
430- describe ( 'with success' , function ( ) {
431- beforeEach ( function ( ) {
432- return storage . updateBuildInfo ( {
433- project : projectId ,
434- build : buildId ,
435- status : 'success'
436- } ) ;
437- } ) ;
438-
439- it ( 'should write success' , function ( ) {
440- return storage . getBuildInfo ( {
441- project : projectId ,
442- build : buildId
443- } )
444- . then ( function ( buildInfo ) {
445- assert . equal ( buildInfo . status , 'success' ) ;
446- } ) ;
447- } ) ;
448-
449- it ( 'should not have diffs' , function ( ) {
450- return storage . getBuildInfo ( {
451- project : projectId ,
452- build : buildId
453- } )
454- . then ( function ( buildInfo ) {
455- assert . isUndefined ( buildInfo . diffs ) ;
456- } ) ;
457- } ) ;
458- } ) ;
459-
460- describe ( 'with failure' , function ( ) {
461- var newBuildInfo ;
462-
463- beforeEach ( function ( ) {
464- newBuildInfo = {
465- project : projectId ,
466- build : buildId ,
467- status : 'failed' ,
468- diffs : {
469- Chrome : [ 'image1.png,' , 'image2.png' ] ,
470- Firefox : [ 'image1.png' ]
471- }
472- } ;
473-
474- return storage . updateBuildInfo ( newBuildInfo ) ;
475- } ) ;
476-
477- it ( 'should write failure' , function ( ) {
478- return storage . getBuildInfo ( {
479- project : projectId ,
480- build : buildId
481- } )
482- . then ( function ( buildInfo ) {
483- assert . equal ( buildInfo . status , 'failed' ) ;
484- } ) ;
485- } ) ;
486-
487- it ( 'should have diffs' , function ( ) {
488- return storage . getBuildInfo ( {
489- project : projectId ,
490- build : buildId
491- } )
492- . then ( function ( buildInfo ) {
493- assert . deepEqual ( buildInfo . diffs , newBuildInfo . diffs ) ;
494- } ) ;
495- } ) ;
496- } ) ;
497- } ) ;
498-
499333 describe ( '#getBrowsersForSha' , function ( ) {
500334 var project ;
501335 var sha ;
0 commit comments