@@ -283,7 +283,21 @@ describe('ember-cli-deploy-chrome-app plugin', function() {
283
283
return rimraf ( distDir ) ;
284
284
} ) ;
285
285
286
- describe ( 'when the request fails' , function ( ) {
286
+ describe ( 'when the oauth token request fails' , function ( ) {
287
+ beforeEach ( function ( ) {
288
+ nock ( 'https://www.googleapis.com' )
289
+ . post ( '/oauth2/v4/token' )
290
+ . reply ( 400 , {
291
+ error : 'invalid grant'
292
+ } ) ;
293
+ } ) ;
294
+
295
+ it ( 'fails to upload the zip file to the chrome webstore' , function ( ) {
296
+ return expect ( plugin . upload ( context ) ) . to . be . rejected ;
297
+ } ) ;
298
+ } ) ;
299
+
300
+ describe ( 'when the upload request fails' , function ( ) {
287
301
beforeEach ( function ( ) {
288
302
nock ( 'https://www.googleapis.com' )
289
303
. post ( '/oauth2/v4/token' )
@@ -301,7 +315,7 @@ describe('ember-cli-deploy-chrome-app plugin', function() {
301
315
} ) ;
302
316
} ) ;
303
317
304
- describe ( 'when the request succeeds' , function ( ) {
318
+ describe ( 'when the upload request succeeds' , function ( ) {
305
319
beforeEach ( function ( ) {
306
320
nock ( 'https://www.googleapis.com' )
307
321
. post ( '/oauth2/v4/token' )
@@ -362,19 +376,21 @@ describe('ember-cli-deploy-chrome-app plugin', function() {
362
376
plugin . configure ( context ) ;
363
377
} ) ;
364
378
365
- describe ( 'when the request fails' , function ( ) {
379
+ describe ( 'when the oauth token request fails' , function ( ) {
366
380
beforeEach ( function ( ) {
367
381
nock ( 'https://www.googleapis.com' )
368
382
. post ( '/oauth2/v4/token' )
369
- . reply ( 401 ) ;
383
+ . reply ( 401 , {
384
+ error : 'invalid_grant'
385
+ } ) ;
370
386
} ) ;
371
387
372
388
it ( 'fails to publish to the chrome webstore' , function ( ) {
373
389
return expect ( plugin . activate ( context ) ) . to . be . rejected ;
374
390
} ) ;
375
391
} ) ;
376
392
377
- describe ( 'when the request succeeds' , function ( ) {
393
+ describe ( 'when the publish request succeeds' , function ( ) {
378
394
beforeEach ( function ( ) {
379
395
nock ( 'https://www.googleapis.com' )
380
396
. post ( '/oauth2/v4/token' )
0 commit comments