dev/actions #26
@@ -36,10 +36,10 @@ func SetupDBFixture(t *testing.T) *DBFixture {
|
||||
t.Fatalf("failed to connect to database: %v", err)
|
||||
}
|
||||
|
||||
err = MigrateDB(db, "file://../../migrations")
|
||||
if err != nil && err != migrate.ErrNoChange {
|
||||
t.Fatalf("Failed to migrate database: %v", err)
|
||||
}
|
||||
// err = MigrateDB(db, "file://../../migrations")
|
||||
// if err != nil && err != migrate.ErrNoChange {
|
||||
// t.Fatalf("Failed to migrate database: %v", err)
|
||||
// }
|
||||
|
||||
tx, err := db.Begin()
|
||||
if err != nil {
|
||||
|
||||
@@ -44,12 +44,12 @@ func TestCheckAnwesenheit(t *testing.T) {
|
||||
if actual = testUser.CheckAnwesenheit(); actual != false {
|
||||
t.Errorf("Checkabwesenheit with no booking should be false but is %t", actual)
|
||||
}
|
||||
tc.Database.Exec("INSERT INTO anwesenheit (timestamp, card_uid, check_in_out, geraet_id) VALUES (NOW() - INTERVAL '2 hour', 'aaaa-aaaa', 1, 1);")
|
||||
tc.Database.Exec("INSERT INTO anwesenheit (timestamp, card_uid, check_in_out, geraet_id) VALUES (NOW() - INTERVAL '2 minute', 'aaaa-aaaa', 1, 1);")
|
||||
if actual = testUser.CheckAnwesenheit(); actual != true {
|
||||
t.Errorf("Checkabwesenheit with 'kommen' booking should be true but is %t", actual)
|
||||
}
|
||||
|
||||
tc.Database.Exec("INSERT INTO anwesenheit (timestamp, card_uid, check_in_out, geraet_id) VALUES (NOW() - INTERVAL '1 hour', 'aaaa-aaaa', 2, 1);")
|
||||
tc.Database.Exec("INSERT INTO anwesenheit (timestamp, card_uid, check_in_out, geraet_id) VALUES (NOW() - INTERVAL '1 minute', 'aaaa-aaaa', 2, 1);")
|
||||
if actual = testUser.CheckAnwesenheit(); actual != false {
|
||||
t.Errorf("Checkabwesenheit with 'gehen' booking should be false but is %t", actual)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user