Navigation Menu

Skip to content

Commit

Permalink
Update tests around new behavior of index field options
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 23, 2012
1 parent c9b67ab commit 41aaeee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions test/database-index-field.test.js
Expand Up @@ -257,6 +257,7 @@ suite('database', function() {
test('invalid modification of options for text field', function() {
var field = new IndexField('name', domain).setType('text');
field.createSync();
field.searchEnabled = true;
assert.throw(function() {
field.searchEnabled = false;
}, 'searchable option cannot be configured for the type text');
Expand All @@ -265,12 +266,15 @@ suite('database', function() {
test('invalid modification of options for uint field', function() {
var field = new IndexField('age', domain).setType('uint');
field.createSync();
field.searchEnabled = true;
assert.throw(function() {
field.searchEnabled = false;
}, 'searchable option cannot be configured for the type uint');
field.facetEnabled = false;
assert.throw(function() {
field.facetEnabled = false;
}, 'facet option cannot be configured for the type uint');
field.resultEnabled = true;
assert.throw(function() {
field.resultEnabled = false;
}, 'returnable option cannot be configured for the type uint');
Expand Down
8 changes: 4 additions & 4 deletions test/gcs-commands.test.js
Expand Up @@ -560,7 +560,7 @@ suite('gcs-configure-fields', function() {

test('change option of text field', function(done) {
testConfigureFieldOptions('text', {
search: 'error',
search: 'Search',
nosearch: 'error',
facet: 'Search Facet',
nofacet: 'Search',
Expand All @@ -571,11 +571,11 @@ suite('gcs-configure-fields', function() {

test('change option of uint field', function(done) {
testConfigureFieldOptions('uint', {
search: 'error',
search: 'Search Result',
nosearch: 'error',
facet: 'error',
nofacet: 'error',
result: 'error',
nofacet: 'Search Result',
result: 'Search Result',
noresult: 'error'
}, done);
});
Expand Down

0 comments on commit 41aaeee

Please sign in to comment.