Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As mentioned previously, mimicking Grails by using BindDynamicMethod works. This works for me on Grails 1.3.5:</p> <pre><code>import org.codehaus.groovy.grails.web.metaclass.BindDynamicMethod protected void setUp() { def mc = controller.class.metaClass def bind = new BindDynamicMethod() mc.bindData = { Object target, Object args -&gt; bind.invoke(delegate, "bindData", [ target, args ] as Object[]) } mc.bindData = { Object target, Object args, List disallowed -&gt; bind.invoke(delegate, "bindData", [ target, args, [ exclude: disallowed ]] as Object[]) } mc.bindData = { Object target, Object args, List disallowed, String filter -&gt; bind.invoke(delegate, "bindData", [ target, args, [ exclude: disallowed ], filter ] as Object[]) } mc.bindData = { Object target, Object args, Map includeExclude -&gt; bind.invoke(delegate, "bindData", [ target, args, includeExclude ] as Object[]) } mc.bindData = { Object target, Object args, Map includeExclude, String filter -&gt; bind.invoke(delegate, "bindData", [ target, args, includeExclude, filter ] as Object[]) } mc.bindData = { Object target, Object args, String filter -&gt; bind.invoke(delegate, "bindData", [ target, args, filter ] as Object[]) } } </code></pre> <p>This is copied from <code>org/codehaus/groovy/grails/plugins/web/ControllersGrailsPlugin.groovy</code>, and so it supports all forms of <code>bindData</code>.</p> <p>Hopefully the situation will improve with the upcoming Grails 1.4 and <a href="http://grails.org/doc/1.4.x/guide/9.%20Testing.html#9.1.1%20Unit%20Testing%20Controllers" rel="nofollow">testing mixins</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload