From 40dd0d4a10e9bbb3928441ad5d4bd1c5be451298 Mon Sep 17 00:00:00 2001 From: Antonio171003 Date: Tue, 10 Sep 2024 21:00:48 -0700 Subject: [PATCH] Fixed test --- .../wiringbits/spra/admin/QueryBuilderSpec.scala | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/spra-play-server/src/test/scala/net/wiringbits/spra/admin/QueryBuilderSpec.scala b/spra-play-server/src/test/scala/net/wiringbits/spra/admin/QueryBuilderSpec.scala index 7f53bfc..66f12c0 100644 --- a/spra-play-server/src/test/scala/net/wiringbits/spra/admin/QueryBuilderSpec.scala +++ b/spra-play-server/src/test/scala/net/wiringbits/spra/admin/QueryBuilderSpec.scala @@ -1,5 +1,6 @@ package net.wiringbits.spra.admin +import net.wiringbits.spra.admin.models.ColumnType import net.wiringbits.spra.admin.repositories.models.TableColumn import net.wiringbits.spra.admin.utils.QueryBuilder import org.scalatest.matchers.must.Matchers.{be, must} @@ -20,7 +21,10 @@ class QueryBuilderSpec extends AnyWordSpec { |""".stripMargin val tableName = "users" val body = - Map(TableColumn("email", "citext") -> "wiringbits@wiringbits.net", TableColumn("name", "text") -> "wiringbits") + Map( + TableColumn("email", ColumnType.parseColumnType("citext")) -> "wiringbits@wiringbits.net", + TableColumn("name", ColumnType.parseColumnType("text")) -> "wiringbits" + ) val primaryKeyField = "user_id" val response = QueryBuilder.create(tableName, body, primaryKeyField) @@ -58,8 +62,8 @@ class QueryBuilderSpec extends AnyWordSpec { |""".stripMargin val tableName = "users" val body = Map( - TableColumn("email", "citext") -> "wiringbits@wiringbits.net", - TableColumn("name", "text") -> "wiringbits@wiringbits.net" + TableColumn("email", ColumnType.parseColumnType("citext")) -> "wiringbits@wiringbits.net", + TableColumn("name", ColumnType.parseColumnType("text")) -> "wiringbits@wiringbits.net" ) val primaryKeyField = "user_id" @@ -76,9 +80,9 @@ class QueryBuilderSpec extends AnyWordSpec { |""".stripMargin val tableName = "users" val body = Map( - TableColumn("email", "citext") -> "wiringbits@wiringbits.net", - TableColumn("name", "text") -> "wiringbits@wiringbits.net", - TableColumn("phone_number", "text") -> "null" + TableColumn("email", ColumnType.parseColumnType("citext")) -> "wiringbits@wiringbits.net", + TableColumn("name", ColumnType.parseColumnType("text")) -> "wiringbits@wiringbits.net", + TableColumn("phone_number", ColumnType.parseColumnType("text")) -> "null" ) val primaryKeyField = "user_id"