title: How to mock the Asset-Pipeline taglib when testing a view
body: <p>I have a test where the gsp uses the Asset Pipeline tag <code>assetPath</code>, in grails 2 I had no issues but in grails 3 I'm getting an <code>org.grails.taglib.GrailsTagException: [SOME_GSP.gsp:184] Error executing tag &lt;g:form&gt;: 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]]</code></p>
  
  <p>Grails 3.1.6</p>
  
  <p>Example test file:</p>
  
  <pre><code>@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')
      }
  }
  </code></pre>