PageRenderTime 334ms CodeModel.GetById 161ms app.highlight 1ms RepoModel.GetById 170ms app.codeStats 1ms

/wheels/tests/view/formsobject/TextField.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 29 lines | 22 code | 7 blank | 0 comment | 0 complexity | 68cb5011b40c222d5bc63bbdf335cdc8 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cfset pkg.controller = controller("controllerWithModelErrors")>
 4
 5	<cffunction name="setup">
 6		<cfset result = "">
 7	</cffunction>
 8
 9	<cffunction name="testDefaultErrorElement">
10		<cfset result = pkg.controller.textField(objectName="user", property="firstName")>
11		<cfset assert("result Contains 'span class=""fieldWithErrors""'")>
12	</cffunction>
13
14	<cffunction name="testCustomErrorElement">
15		<cfset result = pkg.controller.textField(errorElement="div", objectName="user", property="firstName")>
16		<cfset assert("result Contains 'div class=""fieldWithErrors""'")>
17	</cffunction>
18
19	<cffunction name="testDefaultClassOnError">
20		<cfset result = pkg.controller.textField(objectName="user", property="firstName")>
21		<cfset assert("result Contains 'span class=""fieldWithErrors""'")>
22	</cffunction>
23
24	<cffunction name="testCustomClassOnError">
25		<cfset result = pkg.controller.textField(errorClass="customClass", objectName="user", property="firstName")>
26		<cfset assert("result Contains 'span class=""customClass""'")>
27	</cffunction>
28	
29</cfcomponent>