PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/wheels/tests/view/urls/buttonTo.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 28 lines | 23 code | 5 blank | 0 comment | 0 complexity | e86f042e1454047d0912d85881898306 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.controller = controller(name="dummy")>
 5		<cfset oldURLRewriting = application.wheels.URLRewriting>
 6		<cfset application.wheels.URLRewriting = "On">
 7		<cfset oldScriptName = request.cgi.script_name>
 8		<cfset request.cgi.script_name = "/rewrite.cfm">
 9	</cffunction>
10
11	<cffunction name="teardown">
12		<cfset application.wheels.URLRewriting = oldURLRewriting>
13		<cfset request.cgi.script_name = oldScriptName>
14	</cffunction>
15
16	<cffunction name="test_confirm_is_escaped">
17		<cfset loc.e = '<form action="#application.wheels.webpath#" method="post"><input data-confirm="Mark as: \''Completed\''?" type="submit" value="" /></form>'>
18		<cfset loc.r = loc.controller.buttonTo(confirm="Mark as: 'Completed'?")>
19		<cfset assert('loc.e eq loc.r')>
20	</cffunction>
21
22	<cffunction name="test_disabled_is_escaped">
23		<cfset loc.e = '<form action="#application.wheels.webpath#" method="post"><input data-disable-with="Mark as: \''Completed\''?" type="submit" value="" /></form>'>
24		<cfset loc.r = loc.controller.buttonTo(disable="Mark as: 'Completed'?")>
25		<cfset assert('loc.e eq loc.r')>
26	</cffunction>
27
28</cfcomponent>