sbglasius opened a new issue, #14259: URL: https://github.com/apache/grails-core/issues/14259
By @jeffbrown from https://github.com/grails/grails-core/issues/9576 where it was closed. It still seems to be an issue ``` package demo class DemoTagLib { static namespace = 'demo' def putSomethingInPageScope = { attrs -> pageScope.someValue = attrs.foo } } ``` ``` package demo import grails.test.mixin.TestFor import spock.lang.Specification @TestFor(DemoTagLib) class DemoTagLibSpec extends Specification { void "use applyTemplate to test tag that puts something in pageScope"() { when: applyTemplate '<demo:putSomethingInPageScope foo="42"/>' then: tagLib.pageScope.someValue == '42' } void "use tag as method to test tag that puts something in pageScope"() { when: tagLib.putSomethingInPageScope(foo: '42') then: tagLib.pageScope.someValue == '42' } } ``` The applyTemplate approach does not work. I think multiple pageScope (TemplateVariableBinding) objects are being created and the one populated by the tag is not the same one retrieved in the test. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
