Skip to content

Commit 48d6fab

Browse files
committed
refactor 1703 tests
1 parent 362fb1c commit 48d6fab

File tree

2 files changed

+27
-64
lines changed

2 files changed

+27
-64
lines changed

test/gh-1703.test.js

-48
This file was deleted.

test/utils.test.js

+27-16
Original file line numberDiff line numberDiff line change
@@ -285,22 +285,6 @@ describe('utils', function(){
285285
done();
286286
})
287287

288-
describe('clone', function(){
289-
it('retains RegExp options gh-1355', function(done){
290-
var a = new RegExp('hello', 'igm');
291-
assert.ok(a.global);
292-
assert.ok(a.ignoreCase);
293-
assert.ok(a.multiline);
294-
295-
var b = utils.clone(a);
296-
assert.equal(b.source, a.source);
297-
assert.equal(a.global, b.global);
298-
assert.equal(a.ignoreCase, b.ignoreCase);
299-
assert.equal(a.multiline, b.multiline);
300-
done();
301-
})
302-
})
303-
304288
describe('merge', function(){
305289
it('merges two objects together without overriding properties & methods', function(done){
306290
function To() {
@@ -332,5 +316,32 @@ describe('utils', function(){
332316
done();
333317
})
334318
})
319+
320+
describe('pluralize (gh-1703)', function(){
321+
it('should not pluralize _temp_', function(done){
322+
var db = start();
323+
324+
var ASchema = new Schema ({
325+
value: { type: Schema.Types.Mixed }
326+
});
327+
328+
var collectionName = '_temp_';
329+
var A = db.model(collectionName, ASchema);
330+
assert.equal(A.collection.name, collectionName);
331+
done();
332+
});
333+
it('should pluralize _temp', function(done){
334+
var db = start();
335+
336+
var ASchema = new Schema ({
337+
value: { type: Schema.Types.Mixed }
338+
});
339+
340+
var collectionName = '_temp';
341+
var A = db.model(collectionName, ASchema);
342+
assert.equal(A.collection.name, collectionName + 's');
343+
done();
344+
})
345+
});
335346
})
336347

0 commit comments

Comments
 (0)