Skip to content

Commit 3a7e805

Browse files
Fixing TestSelectWithVariables
1 parent 6c0e9a2 commit 3a7e805

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/query_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -959,16 +959,15 @@ func TestPluckWithSelect(t *testing.T) {
959959
}
960960

961961
func TestSelectWithVariables(t *testing.T) {
962-
t.Skip()
963962
DB.Save(&User{Name: "select_with_variables"})
964963

965-
rows, _ := DB.Table("users").Where("name = ?", "select_with_variables").Select("? as fake", gorm.Expr("name")).Rows()
964+
rows, _ := DB.Table("users").Where("\"name\" = ?", "select_with_variables").Select("? as fake", gorm.Expr("\"name\"")).Rows()
966965

967966
if !rows.Next() {
968967
t.Errorf("Should have returned at least one row")
969968
} else {
970969
columns, _ := rows.Columns()
971-
tests.AssertEqual(t, columns, []string{"fake"})
970+
tests.AssertEqual(t, columns, []string{"FAKE"})
972971
}
973972

974973
rows.Close()

0 commit comments

Comments
 (0)