@@ -40,6 +40,7 @@ if (typeof window === 'undefined') { // We're in NodeJS
40
40
// jscs:disable
41
41
imageB64 = 'iVBORw0KGgoAAAANSUhEUgAAACsAAAAmCAAAAAB4qD3CAAABgElEQVQ4y9XUsUocURQGYN/pAyMWBhGtrEIMiFiooGuVIoYsSBAsRSQvYGFWC4uFhUBYsilXLERQsDA20YAguIbo5PQp3F3inVFTheSvZoavGO79z+mJP0/Pv2nPtlfLpfLq9tljNquO62S8mj1kmy/8nrHm/Xaz1930bt5n1+SzVmyrilItsod9ON0td1V59xR9hwV2HsMRsbfROLo4amzsRcQw5vO2CZPJEU5CM2cXYTCxg7CY2mwIVhK7AkNZYg9g4CqxVwNwkNg6zOTKMQP1xFZgKWeXoJLYdSjl7BysJ7YBIzk7Ap8TewLOE3oOTtIz6y/64bfQn55ZTIAPd2gNTOTurcbzp7z50v1y/Pq2Q7Wczca8vFjG6LvbMo92hiPL96xO+eYVPkVExMdONetFXZ+l+eP9cuV7RER8a9PZwrloTXv2tfv285ZOt4rnrTXlydxCu9sZmGrdN8eXC3ATERHXsHD5wC7ZL3HdsaX9R3bUzlb7YWvn/9ipf93+An8cHsx3W3WHAAAAAElFTkSuQmCC' ;
42
42
imageBlob = new Blob ( ) ;
43
+
43
44
// jscs:enable
44
45
}
45
46
}
@@ -131,9 +132,9 @@ describe('Github.Repository', function() {
131
132
132
133
it ( 'should get statuses for a SHA from a repo' , function ( done ) {
133
134
repo . getStatuses ( '20fcff9129005d14cc97b9d59b8a3d37f4fb633b' , function ( err , statuses ) {
134
- statuses . length . should . equal ( 6 )
135
+ statuses . length . should . equal ( 6 ) ;
135
136
statuses . every ( function ( status ) {
136
- return status . url === 'https://api.github.com/repos/michael/github/statuses/20fcff9129005d14cc97b9d59b8a3d37f4fb633b'
137
+ return status . url === 'https://api.github.com/repos/michael/github/statuses/20fcff9129005d14cc97b9d59b8a3d37f4fb633b' ;
137
138
} ) . should . equal ( true ) ;
138
139
done ( ) ;
139
140
} ) ;
@@ -272,14 +273,35 @@ describe('Creating new Github.Repository', function() {
272
273
it ( 'should get pull requests on repo' , function ( done ) {
273
274
var repo = github . getRepo ( 'michael' , 'github' ) ;
274
275
275
- repo . getPull ( 153 , function ( err ) {
276
+ repo . getPull ( 153 , function ( err , pull ) {
276
277
should . not . exist ( err ) ;
277
-
278
- // @TODO write better assertion
278
+ should . exist ( pull . number ) ;
279
+ pull . number . should . equal ( 153 ) ;
280
+ should . exist ( pull . head ) ;
281
+ should . exist ( pull . head . sha ) ;
279
282
done ( ) ;
280
283
} ) ;
281
284
} ) ;
282
285
286
+ it ( 'should merge pull requests on repo' , function ( done ) {
287
+ var repo = github . getRepo ( 'michael' , 'github' ) ;
288
+ var expectedDocUrl = 'https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button' ;
289
+
290
+ repo . getPull ( 153 , function ( err , pull ) {
291
+ repo . mergePull ( pull , function ( err ) {
292
+ should . exist ( err ) ;
293
+ should . exist ( err . request ) ;
294
+ should . exist ( err . request . response ) ;
295
+ var errResponse = JSON . parse ( err . request . response ) ;
296
+
297
+ errResponse . documentation_url . should . equal ( expectedDocUrl ) ;
298
+
299
+ // @TODO write better assertion
300
+ done ( ) ;
301
+ } ) ;
302
+ } ) ;
303
+ } ) ;
304
+
283
305
it ( 'should delete a file on the repo' , function ( done ) {
284
306
repo . write ( 'master' , 'REMOVE-TEST.md' , 'THIS IS A TEST' , 'Remove test' , function ( err ) {
285
307
should . not . exist ( err ) ;
0 commit comments