Improved controller spec code generation