예제 #1
0
파일: rebuild_test.go 프로젝트: tsuru/tsuru
func (s *S) TestRebuildRoutesBetweenRouters(c *check.C) {
	a := app.App{Name: "my-test-app", TeamOwner: s.team.Name}
	err := app.CreateApp(&a, s.user)
	c.Assert(err, check.IsNil)
	err = provisiontest.ProvisionerInstance.AddUnits(&a, 1, "web", nil)
	c.Assert(err, check.IsNil)
	oldIp := a.Ip
	a.Plan = app.Plan{Router: "fake-hc"}
	_, err = rebuild.RebuildRoutes(&a)
	c.Assert(err, check.IsNil)
	c.Assert(a.Ip, check.Not(check.Equals), oldIp)
	na, err := app.GetByName(a.Name)
	c.Assert(err, check.IsNil)
	c.Assert(na.Ip, check.Equals, a.Ip)
}