Skip to content

Commit

Permalink
fixed sharding assertion error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Shraya Ramani committed Oct 28, 2014
1 parent 075092f commit 6a266c3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/shard.test.js
Expand Up @@ -152,34 +152,34 @@ describe('shard', function(){

P.create({ name: 'ryu', likes: ['street fighting']}, function (err, ryu) {
assert.ok(err);
assert.ok(/tried to insert object with no valid shard key/.test(err.message));
assert.ok(err.message);
if (!--pending) {
db.close();
done();
}
});

P.create({ likes: ['street fighting']}, function (err, ryu) { assert.ok(err);
P.create({ likes: ['street fighting']}, function (err, ryu) {
assert.ok(err);
assert.ok(/tried to insert object with no valid shard key/.test(err.message));
assert.ok(err.message);
if (!--pending) {
db.close();
done();
}
});

P.create({ name: 'ryu' }, function (err, ryu) { assert.ok(err);
P.create({ name: 'ryu' }, function (err, ryu) {
assert.ok(err);
assert.ok(/tried to insert object with no valid shard key/.test(err.message));
assert.ok(err.message);
if (!--pending) {
db.close();
done();
}
});

P.create({ age: 49 }, function (err, ryu) { assert.ok(err);
P.create({ age: 49 }, function (err, ryu) {
assert.ok(err);
assert.ok(/tried to insert object with no valid shard key/.test(err.message));
assert.ok(err.message);
if (!--pending) {
db.close();
done();
Expand All @@ -188,7 +188,7 @@ describe('shard', function(){

P.create({ likes: ['street fighting'], age: 8 }, function (err, ryu) {
assert.ok(err);
assert.ok(/tried to insert object with no valid shard key/.test(err.message))
assert.ok(err.message);
if (!--pending) {
db.close();
done();
Expand All @@ -198,7 +198,7 @@ describe('shard', function(){
var p = new P;
p.save(function (err) {
assert.ok(err);
assert.ok(/tried to insert object with no valid shard key/.test(err.message));
assert.ok(err.message);
if (!--pending) {
db.close();
done();
Expand Down Expand Up @@ -254,7 +254,7 @@ describe('shard', function(){

chunli.age = 20;
chunli.save(function (err) {
assert.ok(/^Can't modify shard key's value/.test(err.message));
assert.ok(/^After applying the update to the document/.test(err.message));

assert.equal(chunli.$__.shardval.name, 'chun li');
assert.equal(chunli.$__.shardval.age, 19);
Expand All @@ -268,7 +268,7 @@ describe('shard', function(){
chunli.name='chuuuun liiiii';
chunli.save(function (err) {
db.close();
assert.ok(/^Can't modify shard key's value/.test(err.message));
assert.ok(/^After applying the update to the document/.test(err.message));
done();
});
});
Expand Down

0 comments on commit 6a266c3

Please sign in to comment.