Skip to content

Commit

Permalink
Merge branch 'main' into filtering-by-non-string-column
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC authored Sep 6, 2024
2 parents e270d6c + f95c926 commit 0546ae0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ jobs:

- name: Run tests
run: CI=true sbt +test

- name: Test summary
if: always() # Always run, even if previous steps failed
uses: test-summary/action@v2
with:
paths: "**/target/test-reports/*.xml"
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,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
Expand All @@ -779,6 +779,7 @@ 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 =>
Expand Down Expand Up @@ -902,23 +903,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 =>
Expand Down

0 comments on commit 0546ae0

Please sign in to comment.