Skip to content
Browse files

Merge branch 'master' of github.com:grails/grails-core

  • Loading branch information...
2 parents abc72da + c1d7cd2 commit e1b78b947b02a7f4f3ebc37280c670c182e1792c @graemerocher graemerocher committed Jan 31, 2012
View
2 ...n-testing/src/main/groovy/grails/test/mixin/support/GroovyPageUnitTestResourceLoader.java
@@ -39,7 +39,7 @@ public Resource getResource(String location) {
}
if (groovyPages.containsKey(location)) {
try {
- return new ByteArrayResource(groovyPages.get(location).getBytes("UTF-8"));
+ return new ByteArrayResource(groovyPages.get(location).getBytes("UTF-8"), location);
} catch (UnsupportedEncodingException e) {
// continue
}
View
8 grails-plugin-testing/src/test/groovy/grails/test/mixin/GroovyPageUnitTestMixinTests.groovy
@@ -48,7 +48,14 @@ class GroovyPageUnitTestMixinTests extends GroovyTestCase {
def result = render(view:"/foo/bar")
assert result == null
+ }
+
+ void testCanCallRenderMultipleTimesInOneTest() {
+ views['/_h1.gsp'] = '<h1>${text}</h1>'
+ views['/_h2.gsp'] = '<h2>${text}</h2>'
+ assert applyTemplate('<g:render template="/h1" model="[text: text]"/>', [text: 'A main heading']) == '<h1>A main heading</h1>'
+ assert applyTemplate('<g:render template="/h2" model="[text: text]"/>', [text: 'A sub-heading']) == '<h2>A sub-heading</h2>'
}
void testMockTagLibrary() {
@@ -59,6 +66,7 @@ class GroovyPageUnitTestMixinTests extends GroovyTestCase {
assert result != null
assert result == 'tag contents good'
}
+
}
@Artefact("TagLibrary")

0 comments on commit e1b78b9

Please sign in to comment.
Something went wrong with that request. Please try again.