Unit testing a controller method?
- by Stefan Kendall
I have a controller method like such:
def search = {
def query = params.query
...
render results as JSON
}
How do I unit test this? Specifically, how do I call search to set params.query, and how do I test the results of the method render? Is there a way to mock the render method, perhaps?