PageRenderTime 203ms CodeModel.GetById 100ms app.highlight 1ms RepoModel.GetById 100ms app.codeStats 0ms

/wheels/tests/view/errors/errorMessagesFor.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 24 lines | 20 code | 4 blank | 0 comment | 0 complexity | 628fc65897d48d414166ddc3646bc554 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfset loc.controller = controller(name="ControllerWithModelErrors")>
 5		<cfset loc.args = {}>
 6		<cfset loc.args.objectName = "user">
 7		<cfset loc.args.class = "errors-found">
 8	</cffunction>
 9
10	<cffunction name="test_show_duplicate_errors">
11		<cfset loc.args.showDuplicates = true>
12		<cfset loc.e = loc.controller.errorMessagesFor(argumentcollection=loc.args)>
13		<cfset loc.r = '<ul class="errors-found"><li>firstname error1</li><li>firstname error2</li><li>firstname error2</li></ul>'>
14		<cfset assert("loc.e eq loc.r")>
15	</cffunction>
16
17	<cffunction name="test_do_not_show_duplicate_errors">
18		<cfset loc.args.showDuplicates = false>
19		<cfset loc.e = loc.controller.errorMessagesFor(argumentcollection=loc.args)>
20		<cfset loc.r = '<ul class="errors-found"><li>firstname error1</li><li>firstname error2</li></ul>'>
21		<cfset assert("loc.e eq loc.r")>
22	</cffunction>
23
24</cfcomponent>