@@ -770,7 +770,7 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils {
770
770
}
771
771
772
772
" don't fail if we send a null in an optional parameter" in withApiClient { client =>
773
- val json = """ {"name":"wiringbits","email ":null,"password":"wiringbits"}"""
773
+ val json = """ {"name":"wiringbits","last_name ":null,"email":"[email protected] " ,"password":"wiringbits"}"""
774
774
val path = s " /admin/tables/ ${usersSettings.tableName}"
775
775
val response = POST (path, json).futureValue
776
776
response.header.status mustBe 200
@@ -779,6 +779,7 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils {
779
779
client.getTableMetadata(usersSettings.tableName, List (" name" , " ASC" ), List (0 , 9 ), " {}" ).futureValue
780
780
781
781
responseMetadata.head.nonEmpty mustBe true
782
+ responseMetadata.head(" last_name" ) mustBe " "
782
783
}
783
784
784
785
" return new user id" in withApiClient { implicit client =>
@@ -902,23 +903,25 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils {
902
903
903
904
" don't fail if we send a null in an optional parameter" in withApiClient { client =>
904
905
val name = " wiringbits"
906
+ val lastName = " test"
905
907
906
908
val password = " wiringbits"
907
- val request = AdminCreateTable .Request (Map (" name" -> name, " email" -> email, " password" -> password))
909
+ val request =
910
+ AdminCreateTable .Request (Map (" name" -> name, " last_name" -> lastName, " email" -> email, " password" -> password))
908
911
client.createItem(" users" , request).futureValue
909
912
val responseMetadata1 =
910
913
client.getTableMetadata(usersSettings.tableName, List (" name" , " ASC" ), List (0 , 9 ), " {}" ).futureValue
911
914
val id = responseMetadata1.head(" id" )
912
915
913
- val json = """ {"email": null}"""
916
+ val json = """ {"last_name":" null" }"""
914
917
val path = s " /admin/tables/ ${usersSettings.tableName}/ $id"
915
918
val response = PUT (path, json).futureValue
916
919
response.header.status mustBe 200
917
920
918
921
val responseMetadata2 =
919
922
client.getTableMetadata(usersSettings.tableName, List (" name" , " ASC" ), List (0 , 9 ), " {}" ).futureValue
920
923
921
- responseMetadata2.head(" email " ) mustBe " "
924
+ responseMetadata2.head(" last_name " ) mustBe " "
922
925
}
923
926
924
927
" fail if the field in body doesn't exists" in withApiClient { client =>
0 commit comments