Fix HasTable tests

This commit is contained in:
Jinzhu 2014-08-29 17:12:12 +08:00
parent 471eda5a12
commit e9ecf9c1aa
1 changed files with 2 additions and 2 deletions

View File

@ -134,13 +134,13 @@ func TestHasTable(t *testing.T) {
Stuff string Stuff string
} }
DB.DropTable(&Foo{}) DB.DropTable(&Foo{})
if table_ok := DB.HasTable(&Foo{}); table_ok { if ok := DB.HasTable(&Foo{}); ok {
t.Errorf("Table should not exist, but does") t.Errorf("Table should not exist, but does")
} }
if err := DB.CreateTable(&Foo{}).Error; err != nil { if err := DB.CreateTable(&Foo{}).Error; err != nil {
t.Errorf("Table should be created") t.Errorf("Table should be created")
} }
if table_ok := DB.HasTable(&Foo{}); !table_ok { if ok := DB.HasTable(&Foo{}); !ok {
t.Errorf("Table should exist, but HasTable informs it does not") t.Errorf("Table should exist, but HasTable informs it does not")
} }
} }