I've asked the exact same question on nabble here
I'm trying to send params or different domains in the controller integration test. But can't get them to bind to the domain class with the prefix of "book"
//Controller action being tested
def saveBook = {
def book = new Book()
bindData(book, params["book"], [include: ['publicPrivacy', 'description', 'title'])
}
//Integration Test -
def bookController = BookContoller()
//Doesn't Bind
bookController.params.publicPrivacy = false
bookController.params.description = "Best book in the world"
bookController.params.title = "The world"
bookController.params.book.publicPrivacy = false
bookController.params.book.description = "Best book in the world"
bookController.params.book.title = "The world"
bookController.params["book"].publicPrivacy = false
bookController.params.[book.description] = "Best book in the world"
bookController.saveBook()
how do i set the "params" with the prefix to be sent to the controller so they bind to the domain?