added tests for controller.go