mirror of
https://github.com/juanfont/headscale.git
synced 2026-03-23 01:49:35 +01:00
Port routes tests to new model
This commit is contained in:
@@ -1153,9 +1153,14 @@ func (s *Suite) TestAutoApproveRoutes(c *check.C) {
|
||||
|
||||
app.db.Save(&machine)
|
||||
|
||||
err = app.processMachineRoutes(&machine)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
machine0ByID, err := app.GetMachineByID(0)
|
||||
c.Assert(err, check.IsNil)
|
||||
|
||||
app.EnableAutoApprovedRoutes(machine0ByID)
|
||||
c.Assert(machine0ByID.GetEnabledRoutes(), check.HasLen, 3)
|
||||
enabledRoutes, err := app.GetEnabledRoutes(machine0ByID)
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(enabledRoutes, check.HasLen, 3)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user