Add unit tests for generate controller