Merge pull request #211 from rbg/master

Fix the HasTable test, for real.
This commit is contained in:
Jinzhu 2014-08-29 22:58:35 +08:00
commit ecc23e4432
1 changed files with 4 additions and 4 deletions

View File

@ -133,14 +133,14 @@ func TestHasTable(t *testing.T) {
Id int
Stuff string
}
db.DropTable(&Foo{})
if table_ok := db.HasTable(&Foo{}); table_ok {
DB.DropTable(&Foo{})
if table_ok := DB.HasTable(&Foo{}); table_ok {
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")
}
if table_ok := db.HasTable(&Foo{}); !table_ok {
if table_ok := DB.HasTable(&Foo{}); !table_ok {
t.Errorf("Table should exist, but HasTable informs it does not")
}
}