completed unit test for controller.js