PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/wheels/tests/view/forms/checkbox.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 24 lines | 21 code | 3 blank | 0 comment | 0 complexity | 1e7fd98a0955cf4c1c6c87fb5b36d7f7 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.controller = createobject("component", "wheelsMapping.tests._assets.controllers.ControllerWithModel")>
 5		<cfset loc.args= {}>
 6		<cfset loc.args.objectName = "user">
 7		<cfset loc.args.label = false>
 8	</cffunction>
 9
10	<cffunction name="test_checked_when_property_value_equals_checkedValue">
11		<cfset loc.args.property = "birthdaymonth">
12		<cfset loc.args.checkedvalue = "11">
13		<cfset debug("loc.controller.checkBox(argumentcollection=loc.args)", false)>
14		<cfset loc.e = '<input checked="checked" id="user-birthdaymonth" name="user[birthdaymonth]" type="checkbox" value="11" /><input id="user-birthdaymonth-checkbox" name="user[birthdaymonth]($checkbox)" type="hidden" value="0" />'>
15		<cfset loc.r = loc.controller.checkBox(argumentcollection=loc.args)>
16		<cfset assert("loc.e eq loc.r")>
17		<cfset loc.args.checkedvalue = "12">
18		<cfset debug("loc.controller.checkBox(argumentcollection=loc.args)", false)>
19		<cfset loc.e = '<input id="user-birthdaymonth" name="user[birthdaymonth]" type="checkbox" value="12" /><input id="user-birthdaymonth-checkbox" name="user[birthdaymonth]($checkbox)" type="hidden" value="0" />'>
20		<cfset loc.r = loc.controller.checkBox(argumentcollection=loc.args)>
21		<cfset assert("loc.e eq loc.r")>
22	</cffunction>
23
24</cfcomponent>