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

/wheels/tests/view/forms/buttonTag.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 27 lines | 21 code | 6 blank | 0 comment | 0 complexity | 17e3cabc1f75bebde09ae0ae9d353f5f MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.controller = controller(name="dummy")>
 5		<cfset loc.imagePath = application.wheels.webPath & application.wheels.imagePath>
 6	</cffunction>
 7
 8	<cffunction name="test_defaults">
 9		<cfset loc.r = loc.controller.buttonTag()>
10		<cfset loc.e = '<button type="submit" value="save">Save changes</button>'>
11		<cfset assert('loc.e eq loc.r')>
12	</cffunction>
13
14	<cffunction name="test_with_image">
15		<cfset loc.r = loc.controller.buttonTag(image="http://www.cfwheels.com/logo.jpg")>
16		<cfset loc.e = '<button type="submit" value="save"><img alt="Logo" src="http://www.cfwheels.com/logo.jpg" type="image" /></button>'>
17		<cfset assert('loc.e eq loc.r')>
18	</cffunction>
19
20	<cffunction name="test_with_disable">
21		<cfset loc.r = loc.controller.buttonTag(disable="Are you sure?")>
22		<cfset loc.e = '<button onclick="this.disabled=true;this.value=''Are you sure?'';this.form.submit();" type="submit" value="save">Save changes</button>'>
23		<cfset assert('loc.e eq loc.r')>
24	</cffunction>
25
26
27</cfcomponent>