dev/actions #26

Merged
tom_trgr merged 41 commits from dev/actions into dev/main 2025-08-29 15:36:00 +02:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit 50bec238a4 - Show all commits

View File

@@ -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 {

View File

@@ -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)
}