@@ -670,7 +670,7 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils {
670
670
}
671
671
672
672
" don't fail if we send a null in an optional parameter" in withApiClient { client =>
673
- val json = """ {"name":"wiringbits","email ":null,"password":"wiringbits"}"""
673
+ val json = """ {"name":"wiringbits","last_name ":null,"email":"test@wiringbits.net" ,"password":"wiringbits"}"""
674
674
val path = s " /admin/tables/ ${usersSettings.tableName}"
675
675
val response = POST (path, json).futureValue
676
676
response.header.status mustBe 200
@@ -679,6 +679,7 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils {
679
679
client.getTableMetadata(usersSettings.tableName, List (" name" , " ASC" ), List (0 , 9 ), " {}" ).futureValue
680
680
681
681
responseMetadata.head.nonEmpty mustBe true
682
+ responseMetadata.head(" last_name" ) mustBe " "
682
683
}
683
684
684
685
" return new user id" in withApiClient { implicit client =>
@@ -802,23 +803,25 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils {
802
803
803
804
" don't fail if we send a null in an optional parameter" in withApiClient { client =>
804
805
val name = " wiringbits"
806
+ val lastName = " test"
805
807
val email = " test@wiringbits.net"
806
808
val password = " wiringbits"
807
- val request = AdminCreateTable .Request (Map (" name" -> name, " email" -> email, " password" -> password))
809
+ val request =
810
+ AdminCreateTable .Request (Map (" name" -> name, " last_name" -> lastName, " email" -> email, " password" -> password))
808
811
client.createItem(" users" , request).futureValue
809
812
val responseMetadata1 =
810
813
client.getTableMetadata(usersSettings.tableName, List (" name" , " ASC" ), List (0 , 9 ), " {}" ).futureValue
811
814
val id = responseMetadata1.head(" id" )
812
815
813
- val json = """ {"email": null}"""
816
+ val json = """ {"last_name":" null" }"""
814
817
val path = s " /admin/tables/ ${usersSettings.tableName}/ $id"
815
818
val response = PUT (path, json).futureValue
816
819
response.header.status mustBe 200
817
820
818
821
val responseMetadata2 =
819
822
client.getTableMetadata(usersSettings.tableName, List (" name" , " ASC" ), List (0 , 9 ), " {}" ).futureValue
820
823
821
- responseMetadata2.head(" email " ) mustBe " "
824
+ responseMetadata2.head(" last_name " ) mustBe " "
822
825
}
823
826
824
827
" fail if the field in body doesn't exists" in withApiClient { client =>
0 commit comments