@@ -670,7 +670,7 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils {
670670 }
671671
672672 " 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":"[email protected] " ,"password":"wiringbits"}""" 674674 val path = s " /admin/tables/ ${usersSettings.tableName}"
675675 val response = POST (path, json).futureValue
676676 response.header.status mustBe 200
@@ -679,8 +679,9 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils {
679679 client.getTableMetadata(usersSettings.tableName, List (" name" , " ASC" ), List (0 , 9 ), " {}" ).futureValue
680680
681681 responseMetadata.head.nonEmpty mustBe true
682+ responseMetadata.head(" last_name" ) mustBe " "
682683 }
683-
684+
684685 " return new user id" in withApiClient { implicit client =>
685686 val user = createUser.futureValue
686687 val response = client.getTableMetadata(usersSettings.tableName, List (" name" , " ASC" ), List (0 , 9 ), " {}" ).futureValue
@@ -802,23 +803,25 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils {
802803
803804 " don't fail if we send a null in an optional parameter" in withApiClient { client =>
804805 val name = " wiringbits"
806+ val lastName = " test"
805807806808 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))
808811 client.createItem(" users" , request).futureValue
809812 val responseMetadata1 =
810813 client.getTableMetadata(usersSettings.tableName, List (" name" , " ASC" ), List (0 , 9 ), " {}" ).futureValue
811814 val id = responseMetadata1.head(" id" )
812815
813- val json = """ {"email": null}"""
816+ val json = """ {"last_name":" null" }"""
814817 val path = s " /admin/tables/ ${usersSettings.tableName}/ $id"
815818 val response = PUT (path, json).futureValue
816819 response.header.status mustBe 200
817820
818821 val responseMetadata2 =
819822 client.getTableMetadata(usersSettings.tableName, List (" name" , " ASC" ), List (0 , 9 ), " {}" ).futureValue
820823
821- responseMetadata2.head(" email " ) mustBe " "
824+ responseMetadata2.head(" last_name " ) mustBe " "
822825 }
823826
824827 " fail if the field in body doesn't exists" in withApiClient { client =>
0 commit comments