PageRenderTime 16ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/wheels/tests/view/forms/htmlAttributes.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 25 lines | 20 code | 5 blank | 0 comment | 0 complexity | 4ee83552b2f8612b5b1530a8ee62e7aa MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.controller = controller(name="ControllerWithModel")>
 5	</cffunction>
 6
 7	<cffunction name="test_tag_with_disabled_and_readonly_set_to_true">
 8		<cfset loc.textField = loc.controller.textFieldTag(label="First Name", name="firstName", disabled=true, readonly=true)>
 9		<cfset loc.expected = '<label for="firstName">First Name<input disabled="disabled" id="firstName" name="firstName" readonly="readonly" type="text" value="" /></label>'>
10		<cfset assert('loc.expected eq loc.textField')>
11	</cffunction>
12
13	<cffunction name="test_tag_with_disabled_and_readonly_set_to_false">
14		<cfset loc.textField = loc.controller.textFieldTag(label="First Name", name="firstName", disabled=false, readonly=false)>
15		<cfset loc.expected = '<label for="firstName">First Name<input id="firstName" name="firstName" type="text" value="" /></label>'>
16		<cfset assert('loc.expected eq loc.textField')>
17	</cffunction>
18
19	<cffunction name="test_tag_with_disabled_and_readonly_set_to_string">
20		<cfset loc.textField = loc.controller.textFieldTag(label="First Name", name="firstName", disabled="cheese", readonly="crackers")>
21		<cfset loc.expected = '<label for="firstName">First Name<input disabled="cheese" id="firstName" name="firstName" readonly="crackers" type="text" value="" /></label>'>
22		<cfset assert('loc.expected eq loc.textField')>
23	</cffunction>
24
25</cfcomponent>