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

/wheels/tests/view/assets/assetQueryString.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 50 lines | 43 code | 7 blank | 0 comment | 1 complexity | e7fc3eb0370d574b6de8876856deaa2b MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="setup">
 4		<cfscript>
 5			loc.controller = controller(name="dummy");
 6			application.wheels.assetQueryString = true;
 7		</cfscript>
 8	</cffunction>
 9
10	<cffunction name="teardown">
11		<cfscript>
12			application.wheels.assetQueryString = false;
13		</cfscript>
14	</cffunction>
15
16	<cffunction name="test_returns_empty_string_when_set_false">
17		<cfscript>
18			application.wheels.assetQueryString = false;
19			loc.e = loc.controller.$appendQueryString();
20			assert('Len(loc.e) eq 0');
21		</cfscript>
22	</cffunction>
23
24	<cffunction name="test_returns_string_when_set_true">
25		<cfscript>
26			loc.e = loc.controller.$appendQueryString();
27			assert('IsSimpleValue(loc.e) eq true');
28		</cfscript>
29	</cffunction>
30
31	<cffunction name="test_returns_match_when_set_to_string">
32		<cfscript>
33			application.wheels.assetQueryString = "MySpecificBuildNumber";
34			loc.e = loc.controller.$appendQueryString();
35			assert('loc.e eq "?MySpecificBuildNumber"');
36		</cfscript>
37	</cffunction>
38
39	<cffunction name="test_returns_same_value_without_reload">
40		<cfscript>
41			loc.iEnd = 100;
42			application.wheels.assetQueryString = "MySpecificBuildNumber";
43			loc.e = loc.controller.$appendQueryString();
44			for (loc.i = 1; loc.i lte loc.iEnd; loc.i++)
45				assert('loc.controller.$appendQueryString() eq loc.e');
46			assert('loc.e eq "?MySpecificBuildNumber"');
47		</cfscript>
48	</cffunction>
49
50</cfcomponent>