1
我在GSP使用資產管道標籤assetPath
測試時,在Grails的2我沒有問題,但在Grails的3我發現了一個org.grails.taglib.GrailsTagException: [SOME_GSP.gsp:184] Error executing tag <g:form>: Error evaluating expression [assetPath(src: 'SOME_PDF.pdf')] on line [60]: No signature of method: SOME_GSP_gsp.assetPath() is applicable for argument types: (java.util.LinkedHashMap) values: [[src:SOME_PDF.pdf]]
如何測試一個視圖
嘲笑資產管道的taglib的Grails 3.1.6
實施例的測試文件:
@TestMixin(GroovyPageUnitTestMixin)
class SomeTests extends Specification {
void "ssn is not returned to the SOME_GSP page"() {
given:
def cmd = new commandObject(SOME_FIELD: 'data')
when:
def renderedView = render(view: 'SOME_GSP', model: [cmd: cmd])
then:
assert !renderedView.contains('data')
}
}