test: typo on table name

This commit is contained in:
Reinaldy Rafli 2021-06-24 15:18:23 +07:00
parent 2d720a1cde
commit 18408e856b
1 changed files with 2 additions and 2 deletions

View File

@ -52,14 +52,14 @@ func TestCreate(t *testing.T) {
})
t.Run("should emit error for primary key not in columns", func(t *testing.T) {
_, _, err := bob.CreateTable("").Columns("name").Types("text").Primary("id").ToSql()
_, _, err := bob.CreateTable("users").Columns("name").Types("text").Primary("id").ToSql()
if err.Error() != "supplied primary column name doesn't exists on columns" {
t.Fatal("should throw an error, it didn't:", err.Error())
}
})
t.Run("should emit error for unique key not in columns", func(t *testing.T) {
_, _, err := bob.CreateTable("").Columns("name").Types("text").Unique("id").ToSql()
_, _, err := bob.CreateTable("users").Columns("name").Types("text").Unique("id").ToSql()
if err.Error() != "supplied unique column name doesn't exists on columns" {
t.Fatal("should throw an error, it didn't:", err.Error())
}