PageRenderTime 44ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/wheels/tests/view/miscellaneous/$addToJavaScriptAttribute.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 26 lines | 22 code | 4 blank | 0 comment | 0 complexity | 4c9ab7feeb04a6c29f54f7d52f1fb858 MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="setup">
  3. <cfset loc.controller = controller(name="dummy")>
  4. <cfset loc.args = {}>
  5. <cfset loc.args.name = "WheelsTesting">
  6. <cfset loc.args.content = "this is a test for the wheel's function $addToJavaScriptAttribute">
  7. <cfset loc.args.attributes = {}>
  8. <cfset loc.args.attributes.WheelsTesting = "testing">
  9. <cfset loc.args.attributes.name = "javascripttag">
  10. </cffunction>
  11. <cffunction name="test_has_attribute_called_name">
  12. <cfset loc.e = loc.controller.$addToJavaScriptAttribute(argumentcollection=loc.args)>
  13. <cfset loc.r = "testing;#loc.args.content#">
  14. <cfset assert("loc.e eq loc.r")>
  15. </cffunction>
  16. <cffunction name="test_does_not_have_attribute_called_name">
  17. <cfset structdelete(loc.args.attributes, "WheelsTesting")>
  18. <cfset loc.e = loc.controller.$addToJavaScriptAttribute(argumentcollection=loc.args)>
  19. <cfset loc.r = loc.args.content>
  20. <cfset assert("loc.e eq loc.r")>
  21. </cffunction>
  22. </cfcomponent>