55 "app/base/database"
66 "app/base/models"
77 "app/base/utils"
8+ managerTestUtils "app/manager/controllers"
89 "net/http"
910 "testing"
1011
@@ -27,28 +28,36 @@ func TestInitDelete(t *testing.T) {
2728
2829func TestSystemDelete (t * testing.T ) {
2930 core .SetupTest (t )
30- w := CreateRequestRouterWithParams ("DELETE" , "/:inventory_id" , del , "" , nil , "" , SystemDeleteHandler , 1 )
31+ w := managerTestUtils .CreateRequestRouterWithParams (
32+ "DELETE" , "/systems/:inventory_id" , del , "" , nil , "" , SystemDeleteHandler , 1 ,
33+ )
3134
3235 assert .Equal (t , http .StatusOK , w .Code )
3336}
3437
3538func TestSystemDeleteWrongAccount (t * testing.T ) {
3639 core .SetupTest (t )
37- w := CreateRequestRouterWithParams ("DELETE" , "/:inventory_id" , del , "" , nil , "" , SystemDeleteHandler , 2 )
40+ w := managerTestUtils .CreateRequestRouterWithParams (
41+ "DELETE" , "/systems/:inventory_id" , del , "" , nil , "" , SystemDeleteHandler , 2 ,
42+ )
3843
3944 assert .Equal (t , http .StatusNotFound , w .Code )
4045}
4146
4247func TestSystemDeleteNotFound (t * testing.T ) {
4348 core .SetupTest (t )
44- w := CreateRequestRouterWithParams ("DELETE" , "/:inventory_id" , del , "" , nil , "" , SystemDeleteHandler , 1 )
49+ w := managerTestUtils .CreateRequestRouterWithParams (
50+ "DELETE" , "/systems/:inventory_id" , del , "" , nil , "" , SystemDeleteHandler , 1 ,
51+ )
4552
4653 assert .Equal (t , http .StatusNotFound , w .Code )
4754}
4855
4956func TestSystemDeleteUnknown (t * testing.T ) {
5057 core .SetupTest (t )
51- w := CreateRequestRouterWithParams ("DELETE" , "/:inventory_id" , "unknownsystem" , "" , nil , "" , SystemDeleteHandler , 1 )
58+ w := managerTestUtils .CreateRequestRouterWithParams (
59+ "DELETE" , "/systems/:inventory_id" , "unknownsystem" , "" , nil , "" , SystemDeleteHandler , 1 ,
60+ )
5261
5362 assert .Equal (t , http .StatusBadRequest , w .Code )
5463}
0 commit comments