PageRenderTime 31ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/controller/rendering/renderpage.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 38 lines | 29 code | 9 blank | 0 comment | 0 complexity | a07562219fb1f241dc26d37035f90519 MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cfinclude template="setupAndTeardown.cfm">
  3. <cfset params = {controller="test", action="test"}>
  4. <cfset loc.controller = controller("test", params)>
  5. <cffunction name="test_rendering_current_action">
  6. <cfset result = loc.controller.renderPage()>
  7. <cfset assert("loc.controller.response() Contains 'view template content'")>
  8. </cffunction>
  9. <cffunction name="test_rendering_view_for_another_controller_and_action">
  10. <cfset result = loc.controller.renderPage(controller="main", action="template")>
  11. <cfset assert("loc.controller.response() Contains 'main controller template content'")>
  12. </cffunction>
  13. <cffunction name="test_rendering_view_for_another_action">
  14. <cfset result = loc.controller.renderPage(action="template")>
  15. <cfset assert("loc.controller.response() Contains 'specific template content'")>
  16. </cffunction>
  17. <cffunction name="test_rendering_specific_template">
  18. <cfset result = loc.controller.renderPage(template="template")>
  19. <cfset assert("loc.controller.response() Contains 'specific template content'")>
  20. </cffunction>
  21. <cffunction name="test_rendering_and_returning_as_string">
  22. <cfset result = loc.controller.renderPage(returnAs="string")>
  23. <cfset assert("NOT StructKeyExists(request.wheels, 'response') AND result Contains 'view template content'")>
  24. </cffunction>
  25. <cffunction name="test_rendering_with_cfthread_in_view">
  26. <cfset result = loc.controller.renderPage(action="withthread")>
  27. <cfset assert("loc.controller.response() Contains '1|Per|Djurner'")>
  28. </cffunction>
  29. </cfcomponent>