Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>When creating artifacts or using scaffolding, Grails uses templates to create the domain classes, controllers, views, etc. The default templates are part of the Grails distribution for out of the box behaviour, but can be customized for project specific needs.</p> <p>Copies the the templates used by Grails during code generation to your project directory:</p> <pre><code>$ grails install-templates src/templates/ ├── artifacts │   ├── Tests.groovy │   ├── ... ├── scaffolding │   ├── Test.groovy │   ├── ... └── war └── web.xml </code></pre> <p>The artifacts directory contains the templates used by the create-* commands.<br> The scaffolding directory contains templates used by the generate-* commands.<br> The war directory contains the web.xml template used to generate the deployment descriptor. </p> <p>So you need to edit: </p> <ul> <li><p><code>src/templates/artifacts/Tests.groovy</code> file, when execute <code>grails create-unit-test</code> or <code>grails create-integration-test</code> commands.</p></li> <li><p><code>src/templates/scaffolding/Test.groovy</code> when execute <code>grails generate-all</code> or <code>grails generate-controller</code> commands.</p></li> </ul> <p>In your case regenerate your controller test and <strong>overwrite only your test file</strong>:</p> <pre><code>$ grails generate-controller com.arturoherrero.Post | Generating controller for domain class com.arturoherrero.Post &gt; File /grails-app/controllers/com/arturoherrero/PostController.groovy already exists. Overwrite?[y,n,a] n &gt; File /test/unit/com/arturoherrero/PostControllerTests.groovy already exists. Overwrite?[y,n,a] y | Finished generation for domain class com.arturoherrero.Post </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    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