1 package org
.codehaus
.groovy
.grails
.cli
;
3 class InstallTemplatesTests
extends AbstractCliTests
{
6 void testInstallTemplatesCreatesTemplates() {
7 gantRun( ["-f", "scripts/CreateApp.groovy"] as String
[])
9 def appDir
= appBase
+ File
.separatorChar
+ System
.getProperty("grails.cli.args")
10 System
.setProperty("base.dir", appDir
)
11 def templatesDirectory
= "${appDir}/src/templates/"
13 assertFalse
"${templatesDirectory} exists, but should not", new File(templatesDirectory
).exists()
15 gantRun( ["-f", "scripts/InstallTemplates.groovy"] as String
[])
17 assertTrue
"${templatesDirectory} does not exist", new File(templatesDirectory
).exists()
19 // expected templates to be installed
21 "/artifacts/Controller.groovy",
22 "/artifacts/DomainClass.groovy",
23 "/artifacts/Service.groovy",
24 "/artifacts/TagLib.groovy",
25 "/artifacts/Tests.groovy",
26 "/artifacts/WebTest.groovy",
27 "/scaffolding/Controller.groovy",
28 "/scaffolding/create.gsp",
29 "/scaffolding/edit.gsp",
30 "/scaffolding/list.gsp",
31 "/scaffolding/show.gsp",
32 "/scaffolding/renderEditor.template"
35 for (t in templates
) {
36 assertTrue
"${templatesDirectory}${t} does not exist", new File(templatesDirectory
+ t
).exists()