Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Some tests to ensure unique references are made

  • Loading branch information...
commit 8ad6a94ccfca47aa2e1bb968ef2c710555cd1bf2 1 parent 5f0ec62
@serby authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/schemata.test.js
View
20 test/schemata.test.js
@@ -158,6 +158,16 @@ describe('schemata', function() {
blog.comments.should.be.an.instanceOf(Array)
})
+ it('create new instances for Array type', function() {
+ var schema = createBlogSchema()
+ , blogA = schema.makeBlank()
+ , blogB = schema.makeBlank()
+
+ blogA.comments.push(1)
+ blogA.comments.should.have.lengthOf(1)
+ blogB.comments.should.have.lengthOf(0)
+ })
+
})
describe('#makeDefault()', function() {
@@ -206,6 +216,16 @@ describe('schemata', function() {
comments: []
})
})
+
+ it('create new instances for Array type', function() {
+ var schema = createBlogSchema()
+ , blogA = schema.makeDefault()
+ , blogB = schema.makeDefault()
+
+ blogA.comments.push(1)
+ blogA.comments.should.have.lengthOf(1)
+ blogB.comments.should.have.lengthOf(0)
+ })
})
describe('#stripUnknownProperties()', function() {
Please sign in to comment.
Something went wrong with that request. Please try again.