Grails2.2.0を使用しています。これはテストする私の方法です:
def extendedSearchIndex () {
log.debug("ExtendedSearchIndex ... ");
def deviceClass = deviceService.getDeviceClass(request)
if (deviceClass == "FeaturePhone") {
render(view: '/featurephone/expanded_search')
}
}
これは私のテスト方法です:
void testExtendedSearchIndex01() {
deviceServiceMock.demand.getDeviceClass(1..10) { def myRequest, boolean verbose ->
return "FeaturePhone"
}
controller.deviceService = deviceServiceMock.createMock()
controller.extendedSearchIndex()
assert view == "/featurephone/expanded_search"
}
ビューがnullであるため、このテストは失敗します。しかし、なぜそれはnullなのですか?そうではない/featurephone/expanded_search
ですか?私は何かが足りないのですか?
ご協力いただきありがとうございます。
–クリス