Skip to content

Commit a3d911a

Browse files
committed
more test fixes for index change
1 parent f0f0706 commit a3d911a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/find_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ exports['ShouldCorrectlyLocatePostAndIncValues'] = function(test) {
795795
*/
796796
exports['Should Correctly Handle FindAndModify Duplicate Key Error'] = function(test) {
797797
client.createCollection('FindAndModifyDuplicateKeyError', function(err, collection) {
798-
collection.ensureIndex(['name', 1], {unique:true}, function(err, index) {
798+
collection.ensureIndex(['name', 1], {unique:true, safe:true}, function(err, index) {
799799
// Test return new document on change
800800
collection.insert([{name:'test1'}, {name:'test2'}], {safe:true}, function(err, doc) {
801801
// Let's modify the document in place
@@ -888,7 +888,7 @@ exports.shouldCorrectlyFindAndModifyDocumentWithDBStrict = function(test) {
888888
exports.shouldCorrectlyFindAndModifyDocumentThatFailsInFirstStep = function(test) {
889889
client.createCollection('shouldCorrectlyFindAndModifyDocumentThatFailsInFirstStep', function(err, collection) {
890890
// Set up an index to force duplicate index erro
891-
collection.ensureIndex([['failIndex', 1]], {unique:true}, function(err, index) {
891+
collection.ensureIndex([['failIndex', 1]], {unique:true, safe:true}, function(err, index) {
892892
// Setup a new document
893893
collection.insert({'a':2, 'b':2, 'failIndex':2}, function(err, doc) {
894894

@@ -1259,7 +1259,7 @@ exports.shouldCorrectlyErrorOutFindAndModifyOnDuplicateRecord = function(test) {
12591259
collection.insert([{'login':'user1'}, {'login':'user2'}], {safe:true}, function(err, docs) {
12601260
var id = docs[1]._id;
12611261
// Set an index
1262-
collection.ensureIndex('login', {unique:true}, function(err, result) {
1262+
collection.ensureIndex('login', {unique:true, safe:true}, function(err, result) {
12631263
// Attemp to modify document
12641264
collection.findAndModify({_id: id}, [], { $set: {login: 'user1'} }, {}, function(err, user){
12651265
test.ok(err != null);

0 commit comments

Comments
 (0)