|
|
|
@ -112,12 +112,13 @@ describe('Model', function () { |
|
|
|
|
c.test[2].again.should.equal('yes'); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('Reject field names beginning with a $ sign or containing a dot, except the three edge cases', function () { |
|
|
|
|
it('Reject field names beginning with a $ sign or containing a dot, except the four edge cases', function () { |
|
|
|
|
var a1 = { $something: 'totest' } |
|
|
|
|
, a2 = { "with.dot": 'totest' } |
|
|
|
|
, e1 = { $$date: 4321 } |
|
|
|
|
, e2 = { $$deleted: true } |
|
|
|
|
, e3 = { $$indexCreated: "indexName" } |
|
|
|
|
, e4 = { $$indexRemoved: "indexName" } |
|
|
|
|
, b; |
|
|
|
|
|
|
|
|
|
// Normal cases
|
|
|
|
@ -127,6 +128,8 @@ describe('Model', function () { |
|
|
|
|
// Edge cases
|
|
|
|
|
b = model.serialize(e1); |
|
|
|
|
b = model.serialize(e2); |
|
|
|
|
b = model.serialize(e3); |
|
|
|
|
b = model.serialize(e4); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('Can serialize string fields with a new line without breaking the DB', function (done) { |
|
|
|
|