@@ -328,7 +328,7 @@ describe('User CRUD tests', function () {
328
328
. send ( {
329
329
username : ''
330
330
} )
331
- . expect ( 400 )
331
+ . expect ( 422 )
332
332
. end ( function ( err , res ) {
333
333
// Handle error
334
334
if ( err ) {
@@ -507,7 +507,7 @@ describe('User CRUD tests', function () {
507
507
verifyPassword : '1234567890-ABC-123-Aa$' ,
508
508
currentPassword : credentials . password
509
509
} )
510
- . expect ( 400 )
510
+ . expect ( 422 )
511
511
. end ( function ( err , res ) {
512
512
if ( err ) {
513
513
return done ( err ) ;
@@ -536,7 +536,7 @@ describe('User CRUD tests', function () {
536
536
verifyPassword : '1234567890Aa$' ,
537
537
currentPassword : 'some_wrong_passwordAa$'
538
538
} )
539
- . expect ( 400 )
539
+ . expect ( 422 )
540
540
. end ( function ( err , res ) {
541
541
if ( err ) {
542
542
return done ( err ) ;
@@ -565,7 +565,7 @@ describe('User CRUD tests', function () {
565
565
verifyPassword : '' ,
566
566
currentPassword : credentials . password
567
567
} )
568
- . expect ( 400 )
568
+ . expect ( 422 )
569
569
. end ( function ( err , res ) {
570
570
if ( err ) {
571
571
return done ( err ) ;
@@ -577,7 +577,7 @@ describe('User CRUD tests', function () {
577
577
} ) ;
578
578
} ) ;
579
579
580
- it ( 'should not be able to change user own password if no new password is at all given ' , function ( done ) {
580
+ it ( 'should not be able to change user own password if not signed in ' , function ( done ) {
581
581
582
582
// Change password
583
583
agent . post ( '/api/users/password' )
@@ -586,7 +586,7 @@ describe('User CRUD tests', function () {
586
586
verifyPassword : '1234567890Aa$' ,
587
587
currentPassword : credentials . password
588
588
} )
589
- . expect ( 400 )
589
+ . expect ( 401 )
590
590
. end ( function ( err , res ) {
591
591
if ( err ) {
592
592
return done ( err ) ;
@@ -759,7 +759,7 @@ describe('User CRUD tests', function () {
759
759
760
760
agent . put ( '/api/users' )
761
761
. send ( userUpdate )
762
- . expect ( 400 )
762
+ . expect ( 422 )
763
763
. end ( function ( userInfoErr , userInfoRes ) {
764
764
if ( userInfoErr ) {
765
765
return done ( userInfoErr ) ;
@@ -811,7 +811,7 @@ describe('User CRUD tests', function () {
811
811
812
812
agent . put ( '/api/users' )
813
813
. send ( userUpdate )
814
- . expect ( 400 )
814
+ . expect ( 422 )
815
815
. end ( function ( userInfoErr , userInfoRes ) {
816
816
if ( userInfoErr ) {
817
817
return done ( userInfoErr ) ;
@@ -888,7 +888,7 @@ describe('User CRUD tests', function () {
888
888
889
889
agent . put ( '/api/users' )
890
890
. send ( userUpdate )
891
- . expect ( 400 )
891
+ . expect ( 401 )
892
892
. end ( function ( userInfoErr , userInfoRes ) {
893
893
if ( userInfoErr ) {
894
894
return done ( userInfoErr ) ;
@@ -906,7 +906,7 @@ describe('User CRUD tests', function () {
906
906
907
907
agent . post ( '/api/users/picture' )
908
908
. send ( { } )
909
- . expect ( 400 )
909
+ . expect ( 401 )
910
910
. end ( function ( userInfoErr , userInfoRes ) {
911
911
if ( userInfoErr ) {
912
912
return done ( userInfoErr ) ;
@@ -960,7 +960,7 @@ describe('User CRUD tests', function () {
960
960
agent . post ( '/api/users/picture' )
961
961
. attach ( 'fieldThatDoesntWork' , './modules/users/client/img/profile/default.png' )
962
962
. send ( credentials )
963
- . expect ( 400 )
963
+ . expect ( 422 )
964
964
. end ( function ( userInfoErr , userInfoRes ) {
965
965
done ( userInfoErr ) ;
966
966
} ) ;
0 commit comments