From d192b2ea05dd71438511108d667c9a9b66e76c97 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Fri, 27 Mar 2015 14:18:17 -0700 Subject: [PATCH] Fix the test cases so that they be run with the mssql connector For SQL server, if the PK is an identity, the id cannot be set for insert. --- test/basic-querying.test.js | 12 ++++++------ test/manipulation.test.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/basic-querying.test.js b/test/basic-querying.test.js index 288452de..e570dd0e 100644 --- a/test/basic-querying.test.js +++ b/test/basic-querying.test.js @@ -63,12 +63,12 @@ describe('basic-querying', function () { var createdUsers; before(function(done) { var people = [ - { id: 1, name: 'a', vip: true }, - { id: 2, name: 'b' }, - { id: 3, name: 'c' }, - { id: 4, name: 'd', vip: true }, - { id: 5, name: 'e' }, - { id: 6, name: 'f' } + { name: 'a', vip: true }, + { name: 'b' }, + { name: 'c' }, + { name: 'd', vip: true }, + { name: 'e' }, + { name: 'f' } ]; db.automigrate(['User'], function(err) { User.create(people, function(err, users) { diff --git a/test/manipulation.test.js b/test/manipulation.test.js index dedf4aeb..b6efb87b 100644 --- a/test/manipulation.test.js +++ b/test/manipulation.test.js @@ -295,7 +295,7 @@ describe('manipulation', function () { it('should refuse to create object with duplicate id', function(done) { // NOTE(bajtos) We cannot reuse Person model here, // `settings.forceId` aborts the CREATE request at the validation step. - var Product = db.define('Product', { name: String }); + var Product = db.define('ProductTest', { name: String }); db.automigrate(function(err) { if (err) return done(err);