@@ -7,7 +7,6 @@ function getBaseVariableStore(toExclude) {
77 vs . var ( 'ngram:analyzer' , 'analyzer value' ) ;
88 vs . var ( 'ngram:field' , 'field value' ) ;
99 vs . var ( 'ngram:boost' , 'boost value' ) ;
10- vs . var ( 'ngram:cutoff_frequency' , 'cutoff_frequency value' ) ;
1110
1211 if ( toExclude ) {
1312 vs . unset ( toExclude ) ;
@@ -52,7 +51,6 @@ module.exports.tests.no_exceptions_conditions = function(test, common) {
5251 'field value' : {
5352 analyzer : { $ : 'analyzer value' } ,
5453 boost : { $ : 'boost value' } ,
55- cutoff_frequency : { $ : 'cutoff_frequency value' } ,
5654 query : { $ : 'name value' }
5755 }
5856 }
@@ -78,7 +76,6 @@ module.exports.tests.fuzziness_variable = function(test, common) {
7876 analyzer : { $ : 'analyzer value' } ,
7977 boost : { $ : 'boost value' } ,
8078 query : { $ : 'name value' } ,
81- cutoff_frequency : { $ : 'cutoff_frequency value' } ,
8279 fuzziness : { $ : 'fuzziness value' }
8380 }
8481 }
@@ -90,6 +87,30 @@ module.exports.tests.fuzziness_variable = function(test, common) {
9087 } ) ;
9188} ;
9289
90+ module . exports . tests . cutoff_frequency = function ( test , common ) {
91+ test ( 'cutoff_frequency variable should be presented in query' , function ( t ) {
92+ var store = getBaseVariableStore ( ) ;
93+ store . var ( 'ngram:cutoff_frequency' , 'cutoff_frequency value' ) ;
94+
95+ var actual = ngrams ( store ) ;
96+
97+ var expected = {
98+ match : {
99+ 'field value' : {
100+ analyzer : { $ : 'analyzer value' } ,
101+ boost : { $ : 'boost value' } ,
102+ query : { $ : 'name value' } ,
103+ cutoff_frequency : { $ : 'cutoff_frequency value' }
104+ }
105+ }
106+ } ;
107+
108+ t . deepEquals ( actual , expected , 'should have returned object with cutoff_frequency field' ) ;
109+ t . end ( ) ;
110+
111+ } ) ;
112+ } ;
113+
93114module . exports . all = function ( tape , common ) {
94115 function test ( name , testFunction ) {
95116 return tape ( 'ngrams ' + name , testFunction ) ;
0 commit comments