diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 8496ad3..fbad31c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -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" diff --git a/spra-play-server/src/test/scala/controllers/AdminControllerSpec.scala b/spra-play-server/src/test/scala/controllers/AdminControllerSpec.scala index 7194e23..2114dde 100644 --- a/spra-play-server/src/test/scala/controllers/AdminControllerSpec.scala +++ b/spra-play-server/src/test/scala/controllers/AdminControllerSpec.scala @@ -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":"test@wiringbits.net","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,15 +803,17 @@ 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 = "test@wiringbits.net" 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 @@ -818,7 +821,7 @@ class AdminControllerSpec extends PlayPostgresSpec with AdminUtils { 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 =>