@@ -383,40 +383,6 @@ func TestCreateClient(t *testing.T) {
383
383
}
384
384
},
385
385
},
386
- {
387
- Name : "test create cordova mobile client succeeds without error" ,
388
- Args : []string {"test" , "cordova" },
389
- MobileClient : func () mc.Interface {
390
- mc := & mcFake.Clientset {}
391
- mc .AddReactor ("create" , "mobileclients" , func (action kt.Action ) (handled bool , ret runtime.Object , err error ) {
392
- ca := action .(kt.CreateAction )
393
- return true , ca .GetObject (), nil
394
- })
395
- return mc
396
- },
397
- Flags : []string {"--namespace=myproject" , "-o=json" },
398
- Validate : func (t * testing.T , c * v1alpha1.MobileClient ) {
399
- if nil == c {
400
- t .Fatal ("expected a mobile client but got nil" )
401
- }
402
- if c .Spec .ClientType != "cordova" {
403
- t .Fatal ("expected the clientType to be cordova but got " , c .Spec .ClientType )
404
- }
405
- if c .Spec .Name != "test" {
406
- t .Fatal ("expected the client name to be test but got " , c .Spec .Name )
407
- }
408
- if c .Spec .ApiKey == "" {
409
- t .Fatal ("expected an apiKey to be generated but it was empty" )
410
- }
411
- icon , ok := c .Labels ["icon" ]
412
- if ! ok {
413
- t .Fatal ("expected an icon to be set but there was none" )
414
- }
415
- if icon != "icon-cordova" {
416
- t .Fatal ("expected the icon to be icon-cordova but got " , icon )
417
- }
418
- },
419
- },
420
386
{
421
387
Name : "test create mobile client fails with unknown client type" ,
422
388
Args : []string {"test" , "firefox" },
@@ -432,9 +398,10 @@ func TestCreateClient(t *testing.T) {
432
398
Flags : []string {"--namespace=myproject" , "-o=json" },
433
399
},
434
400
{
435
- Name : "test create mobile client fails when missing required arguments" ,
436
- Args : []string {"test" },
437
- ExpectError : true ,
401
+ Name : "test create mobile client fails when missing required arguments" ,
402
+ Args : []string {"test" },
403
+ ExpectError : true ,
404
+ ErrorPattern : "^expected a name and a clientType" ,
438
405
MobileClient : func () mc.Interface {
439
406
mc := & mcFake.Clientset {}
440
407
mc .AddReactor ("create" , "mobileclients" , func (action kt.Action ) (handled bool , ret runtime.Object , err error ) {
@@ -448,7 +415,7 @@ func TestCreateClient(t *testing.T) {
448
415
Name : "test create mobile client fails with clear error message" ,
449
416
Args : []string {"test" , "cordova" },
450
417
ExpectError : true ,
451
- ErrorPattern : "^failed to create mobile client:.* " ,
418
+ ErrorPattern : "^failed to create mobile client: something went wrong " ,
452
419
MobileClient : func () mc.Interface {
453
420
mc := & mcFake.Clientset {}
454
421
mc .AddReactor ("create" , "mobileclients" , func (action kt.Action ) (handled bool , ret runtime.Object , err error ) {
0 commit comments