-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-data-provider-to-manage-images
- Loading branch information
Showing
2 changed files
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -670,7 +670,7 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils { | |
} | ||
|
||
"don't fail if we send a null in an optional parameter" in withApiClient { client => | ||
val json = """{"name":"wiringbits","email":null,"password":"wiringbits"}""" | ||
val json = """{"name":"wiringbits","last_name":null,"email":"[email protected]","password":"wiringbits"}""" | ||
val path = s"/admin/tables/${usersSettings.tableName}" | ||
val response = POST(path, json).futureValue | ||
response.header.status mustBe 200 | ||
|
@@ -679,8 +679,9 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils { | |
client.getTableMetadata(usersSettings.tableName, List("name", "ASC"), List(0, 9), "{}").futureValue | ||
|
||
responseMetadata.head.nonEmpty mustBe true | ||
responseMetadata.head("last_name") mustBe "" | ||
} | ||
|
||
"return new user id" in withApiClient { implicit client => | ||
val user = createUser.futureValue | ||
val response = client.getTableMetadata(usersSettings.tableName, List("name", "ASC"), List(0, 9), "{}").futureValue | ||
|
@@ -802,23 +803,25 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils { | |
|
||
"don't fail if we send a null in an optional parameter" in withApiClient { client => | ||
val name = "wiringbits" | ||
val lastName = "test" | ||
val email = "[email protected]" | ||
val password = "wiringbits" | ||
val request = AdminCreateTable.Request(Map("name" -> name, "email" -> email, "password" -> password)) | ||
val request = | ||
AdminCreateTable.Request(Map("name" -> name, "last_name" -> lastName, "email" -> email, "password" -> password)) | ||
client.createItem("users", request).futureValue | ||
val responseMetadata1 = | ||
client.getTableMetadata(usersSettings.tableName, List("name", "ASC"), List(0, 9), "{}").futureValue | ||
val id = responseMetadata1.head("id") | ||
|
||
val json = """{"email":null}""" | ||
val json = """{"last_name":"null"}""" | ||
val path = s"/admin/tables/${usersSettings.tableName}/$id" | ||
val response = PUT(path, json).futureValue | ||
response.header.status mustBe 200 | ||
|
||
val responseMetadata2 = | ||
client.getTableMetadata(usersSettings.tableName, List("name", "ASC"), List(0, 9), "{}").futureValue | ||
|
||
responseMetadata2.head("email") mustBe "" | ||
responseMetadata2.head("last_name") mustBe "" | ||
} | ||
|
||
"fail if the field in body doesn't exists" in withApiClient { client => | ||
|