@@ -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}
@@ -425,6 +426,42 @@ describe('Creating new Github.Repository', function() {
425426 } ) ;
426427 } ) ;
427428
429+ it . only ( 'should merge pull requests on repo' , function ( done ) {
430+
431+ var baseBranch = 'master' ;
432+ var headBranch = 'pull-request' ;
433+ var pullRequestTitle = 'Test pull request' ;
434+ var pullRequestBody = 'This is a test pull request to be merged' ;
435+
436+ repo . branch ( baseBranch , headBranch , function ( ) {
437+ repo . write ( headBranch , 'TEST.md' , 'THIS IS AN UPDATED TEST THAT WILL GET MERGED' , 'Updating test' , function ( ) {
438+ repo . createPullRequest (
439+ {
440+ title : pullRequestTitle ,
441+ body : pullRequestBody ,
442+ base : baseBranch ,
443+ head : headBranch
444+ } ,
445+ function ( err , pullRequest , xhr ) {
446+ should . not . exist ( err ) ;
447+ xhr . should . be . instanceof ( XMLHttpRequest ) ;
448+
449+ repo . mergePull ( pullRequest , function ( err , mergedPullRequest , xhr ) {
450+ should . not . exist ( err ) ;
451+ xhr . should . be . instanceof ( XMLHttpRequest ) ;
452+
453+ should . exist ( mergedPullRequest . sha ) ;
454+ should ( mergedPullRequest . merged ) . equal ( true ) ;
455+ should . exist ( mergedPullRequest . message ) ;
456+
457+ done ( ) ;
458+ } ) ;
459+ }
460+ ) ;
461+ } ) ;
462+ } ) ;
463+ } ) ;
464+
428465 it ( 'should delete a file on the repo' , function ( done ) {
429466 repo . write ( 'master' , 'REMOVE-TEST.md' , 'THIS IS A TEST' , 'Remove test' , function ( err ) {
430467 should . not . exist ( err ) ;
0 commit comments