Delete a measurement

This commit is contained in:
Matthew Dillon 2014-12-02 14:45:00 -09:00
parent bc3c724a1d
commit 4eecb36e34
9 changed files with 141 additions and 0 deletions

View file

@ -118,3 +118,22 @@ func TestMeasurementsStore_Update_db(t *testing.T) {
t.Error("!updated")
}
}
func TestMeasurementsStore_Delete_db(t *testing.T) {
tx, _ := DB.Begin()
defer tx.Rollback()
measurement := insertMeasurement(t, tx)
d := NewDatastore(tx)
// Delete it
deleted, err := d.Measurements.Delete(measurement.Id)
if err != nil {
t.Fatal(err)
}
if !deleted {
t.Error("!delete")
}
}