Add functional tests to controller