Restructure test directory and add tests for the controller