Skip to content

Commit

Permalink
We have to save changes to apply modifications on the database
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Nov 21, 2012
1 parent fac3844 commit b209df3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/database-index-field.test.js
Expand Up @@ -662,10 +662,11 @@ suite('database', function() {
test('for non-existing field', function() {
var product = new IndexField('product', domain);
product.type = 'text';
product.saveSync();
assert.equal(product.type, 'text');
product.type = 'literal';
assert.equal(product.type, 'literal');
product.saveSync();
assert.equal(product.type, 'literal');
});

test('for existing field (text to literal)', function() {
Expand All @@ -679,6 +680,7 @@ suite('database', function() {
]);

field.type = 'literal';
field.saveSync();
assert.equal(field.type, 'literal');

var actualDump = field.domain.dumpSync();
Expand All @@ -700,6 +702,7 @@ suite('database', function() {
]);

field.type = 'text';
field.saveSync();
assert.isFalse(field.multipleValues);
assert.equal(field.type, 'text');

Expand All @@ -723,6 +726,7 @@ suite('database', function() {
]);

field.type = 'uint';
field.saveSync();
assert.isFalse(field.multipleValues);
assert.equal(field.type, 'uint');

Expand All @@ -746,6 +750,7 @@ suite('database', function() {
]);

field.type = 'text';
field.saveSync();
assert.isFalse(field.multipleValues);
assert.equal(field.type, 'text');

Expand All @@ -769,6 +774,7 @@ suite('database', function() {
]);

field.type = 'uint';
field.saveSync();
assert.isFalse(field.multipleValues);
assert.equal(field.type, 'uint');

Expand All @@ -793,6 +799,7 @@ suite('database', function() {
]);

field.type = 'literal';
field.saveSync();
assert.isFalse(field.multipleValues);
assert.equal(field.type, 'literal');

Expand Down

0 comments on commit b209df3

Please sign in to comment.