Skip to content

Commit

Permalink
#4 Needing to add refresh() method to test search. Created failing te…
Browse files Browse the repository at this point in the history
…st for refresh()
  • Loading branch information
DominicWatson committed Aug 31, 2012
1 parent 69198a8 commit f362d56
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/integration/WrapperTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,26 @@
</cfscript>
</cffunction>

<cffunction name="t13_search_shouldReturnAllDocs_whenStarIsSuppliedAsQuery" returntype="void">
<cffunction name="t13_refresh_shouldRefreshAnIndex" returntype="void">
<cfscript>
var indexName = "refreshTest";
var type = "dummyType";
var nDocs = _addABunchOfDocs( indexName, type );
var result = wrapper.refresh( indexName );

super.assert( IsStruct( result ), "Result not in expected format" );
super.assert( result.ok );
</cfscript>
</cffunction>

<cffunction name="t14_search_shouldReturnAllDocs_whenStarIsSuppliedAsQuery" returntype="void">
<cfscript>
var indexName = "simpleSearchTest";
var type = "dummyType";
var result = "";
var nDocs = _addABunchOfDocs( indexName, type );

result = wrapper.search( indexName, "*" );

super.assert( IsStruct( result ) and StructKeyExists( result, 'hits' ), "Result was not in expected format" );
super.assertEquals( nDocs, result.hits.total );
super.assertEquals( nDocs, ArrayLen( result.hits.hits ) );
Expand Down

0 comments on commit f362d56

Please sign in to comment.