Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finished authentication; added unit tests to include the Examples pag…
…es to check for 200 status
- Loading branch information
Showing
4 changed files
with
612 additions
and
534 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<cfcomponent extends="mxunit.framework.TestCase"> | ||
|
||
<cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test"> | ||
<cfset variables.rootURL = "http://" & cgi.SERVER_NAME & ":" & cgi.SERVER_PORT & "/cfmongodb/examples/"> | ||
<cfset debug(cgi)> | ||
|
||
<cfset paths = ["gettingstarted.cfm", "aggregation/group.cfm", "aggregation/mapReduce.cfm", "geospatial/geo.cfm", "PeopleList/index.cfm"]> | ||
|
||
</cffunction> | ||
|
||
|
||
<cffunction name="all_examples_should_work" returntype="void" access="public"> | ||
<cfset var httpResult = ""> | ||
<cfset var path = ""> | ||
<cfset var currentURL = ""> | ||
<cfloop array="#paths#" index="path"> | ||
<cfset currentURL = variables.rootURL & path> | ||
<cfhttp method="get" url="#currentURL#" result="httpResult"> | ||
<cfif httpResult.statusCode neq "200 OK"> | ||
|
||
<cfset debug(httpResult.fileContent)> | ||
<cfset fail("For #currentURL#, path Expected 200 OK but received #httpResult.statusCode#.")> | ||
|
||
</cfif> | ||
</cfloop> | ||
|
||
</cffunction> | ||
|
||
</cfcomponent> |
Oops, something went wrong.