tag:blogger.com,1999:blog-4919603745642637061.post4846595903442008103..comments2011-04-08T22:57:40.059+01:00Comments on STATE YOUR BIZNESS: Unit Testing Controllers With The Testing PluginSimon Bakerhttp://www.blogger.com/profile/16011032252131010150noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-4919603745642637061.post-5569296775303062882008-12-10T15:51:00.000+00:002008-12-10T15:51:00.000+00:00We've just added a bindData method to our Cont...We've just added a bindData method to our ControllerTestCase as it's not available out of the box with the testing plugin. Code like so: <BR/><BR/><BR/>void setUp() {<BR/> super.setUp()<BR/> controller = new MyLovelyController()<BR/> controller.metaClass.bindData = { target, params -><BR/> params.each { key, value -><BR/> controller.myBean."$key" = value <BR/> }<BR/> }<BR/> }<BR/><BR/>Apologies for the code formatting. This comment entry window is really crap and doesn't allow pre, code or any such tags :(Gus Powerhttps://www.blogger.com/profile/16140134169400227628noreply@blogger.com