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

/wheels/tests/view/formsdateobject/DateTimeSelect.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 37 lines | 31 code | 6 blank | 0 comment | 0 complexity | fc6f9e1de9bb5fd3b5e0a0fbdee9eb41 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.controller = controller(name="ControllerWithModel")>
 5		<cfset loc.args= {}>
 6		<cfset loc.args.objectName = "user">
 7		<cfset loc.args.label = false>
 8		
 9		<cfset loc.selected = {}>
10		<cfset loc.selected.month = '<option selected="selected" value="11">November</option>'>
11		<cfset loc.selected.day = '<option selected="selected" value="1">1</option>'>
12		<cfset loc.selected.year = '<option selected="selected" value="1975">1975</option>'>
13	</cffunction>
14
15	<cffunction name="testSplittingLabels">
16		<cfset result = loc.controller.dateTimeSelect(objectName="user", property="birthday", label="labelMonth,labelDay,labelYear,labelHour,labelMinute,labelSecond")>
17		<cfset assert("result Contains 'labelDay' AND result Contains 'labelSecond'")>
18	</cffunction>
19
20	<cffunction name="test_datetimeselect">
21		<cfset loc.args.property = "birthday">
22		<cfset loc.r = loc.controller.dateTimeSelect(argumentcollection=loc.args)>
23		<cfset assert("loc.r contains loc.selected.month")>
24		<cfset assert("loc.r contains loc.selected.day")>
25		<cfset assert("loc.r contains loc.selected.year")>
26	</cffunction>
27
28	<cffunction name="test_datetimeselect_not_combined">
29		<cfset loc.args.property = "birthday">
30		<cfset loc.args.combine = "false">
31		<cfset loc.r = loc.controller.dateTimeSelect(argumentcollection=loc.args)>
32		<cfset assert("loc.r contains loc.selected.month")>
33		<cfset assert("loc.r contains loc.selected.day")>
34		<cfset assert("loc.r contains loc.selected.year")>
35	</cffunction>
36
37</cfcomponent>