@@ -33,6 +33,7 @@ if (typeof window === 'undefined') { // We're in NodeJS
3333 // jscs:disable
3434 imageB64 = 'iVBORw0KGgoAAAANSUhEUgAAACsAAAAmCAAAAAB4qD3CAAABgElEQVQ4y9XUsUocURQGYN/pAyMWBhGtrEIMiFiooGuVIoYsSBAsRSQvYGFWC4uFhUBYsilXLERQsDA20YAguIbo5PQp3F3inVFTheSvZoavGO79z+mJP0/Pv2nPtlfLpfLq9tljNquO62S8mj1kmy/8nrHm/Xaz1930bt5n1+SzVmyrilItsod9ON0td1V59xR9hwV2HsMRsbfROLo4amzsRcQw5vO2CZPJEU5CM2cXYTCxg7CY2mwIVhK7AkNZYg9g4CqxVwNwkNg6zOTKMQP1xFZgKWeXoJLYdSjl7BysJ7YBIzk7Ap8TewLOE3oOTtIz6y/64bfQn55ZTIAPd2gNTOTurcbzp7z50v1y/Pq2Q7Wczca8vFjG6LvbMo92hiPL96xO+eYVPkVExMdONetFXZ+l+eP9cuV7RER8a9PZwrloTXv2tfv285ZOt4rnrTXlydxCu9sZmGrdN8eXC3ATERHXsHD5wC7ZL3HdsaX9R3bUzlb7YWvn/9ipf93+An8cHsx3W3WHAAAAAElFTkSuQmCC' ;
3535 imageBlob = new Blob ( ) ;
36+
3637 // jscs:enable
3738 }
3839}
@@ -528,12 +529,15 @@ describe('Creating new Github.Repository', function() {
528529 } ) ;
529530 } ) ;
530531
532+ var sha ;
533+
531534 it ( 'should be able to write an image to the repo' , function ( done ) {
532535 repo . write ( 'master' , 'TEST_image.png' , imageB64 , 'Image test' , {
533536 encode : false
534537 } , function ( err , res , xhr ) {
535538 should . not . exist ( err ) ;
536539 xhr . should . be . instanceof ( XMLHttpRequest ) ;
540+ sha = res . commit . sha ;
537541
538542 done ( ) ;
539543 } ) ;
@@ -578,6 +582,59 @@ describe('Creating new Github.Repository', function() {
578582 } ) ;
579583 } ) ;
580584 } ) ;
585+
586+ var releaseId ;
587+ var releaseTag = 'foo' ;
588+ var releaseName = 'My awesome release' ;
589+ var releaseBody = 'Foo bar bazzy baz' ;
590+
591+ it ( 'should create a release' , function ( done ) {
592+ var options = {
593+ tag_name : releaseTag ,
594+ target_commitish : sha
595+ } ;
596+
597+ repo . createRelease ( options , function ( err , res , xhr ) {
598+ should . not . exist ( err ) ;
599+ xhr . should . be . instanceof ( XMLHttpRequest ) ;
600+
601+ releaseId = res . id ;
602+ done ( ) ;
603+ } ) ;
604+ } ) ;
605+
606+ it ( 'should edit a release' , function ( done ) {
607+ var options = {
608+ name : releaseName ,
609+ body : releaseBody
610+ } ;
611+
612+ repo . editRelease ( releaseId , options , function ( err , res , xhr ) {
613+ should . not . exist ( err ) ;
614+ res . name . should . equal ( releaseName ) ;
615+ res . body . should . equal ( releaseBody ) ;
616+ xhr . should . be . instanceof ( XMLHttpRequest ) ;
617+
618+ done ( ) ;
619+ } ) ;
620+ } ) ;
621+
622+ it ( 'should read a release' , function ( done ) {
623+ repo . getRelease ( releaseId , function ( err , res , xhr ) {
624+ should . not . exist ( err ) ;
625+ res . name . should . equal ( releaseName ) ;
626+ xhr . should . be . instanceof ( XMLHttpRequest ) ;
627+ done ( ) ;
628+ } ) ;
629+ } ) ;
630+
631+ it ( 'should delete a release' , function ( done ) {
632+ repo . deleteRelease ( releaseId , function ( err , res , xhr ) {
633+ should . not . exist ( err ) ;
634+ xhr . should . be . instanceof ( XMLHttpRequest ) ;
635+ done ( ) ;
636+ } ) ;
637+ } ) ;
581638} ) ;
582639
583640describe ( 'deleting a Github.Repository' , function ( ) {
0 commit comments