-
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.
- Loading branch information
1 parent
6864ff8
commit 40dd0d4
Showing
1 changed file
with
10 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") -> "[email protected]", TableColumn("name", "text") -> "wiringbits") | ||
Map( | ||
TableColumn("email", ColumnType.parseColumnType("citext")) -> "[email protected]", | ||
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") -> "[email protected]", | ||
TableColumn("name", "text") -> "[email protected]" | ||
TableColumn("email", ColumnType.parseColumnType("citext")) -> "[email protected]", | ||
TableColumn("name", ColumnType.parseColumnType("text")) -> "[email protected]" | ||
) | ||
val primaryKeyField = "user_id" | ||
|
||
|
@@ -76,9 +80,9 @@ class QueryBuilderSpec extends AnyWordSpec { | |
|""".stripMargin | ||
val tableName = "users" | ||
val body = Map( | ||
TableColumn("email", "citext") -> "[email protected]", | ||
TableColumn("name", "text") -> "[email protected]", | ||
TableColumn("phone_number", "text") -> "null" | ||
TableColumn("email", ColumnType.parseColumnType("citext")) -> "[email protected]", | ||
TableColumn("name", ColumnType.parseColumnType("text")) -> "[email protected]", | ||
TableColumn("phone_number", ColumnType.parseColumnType("text")) -> "null" | ||
) | ||
val primaryKeyField = "user_id" | ||
|
||
|