不要怂,就是干,撸起袖子干!

Commit 52f5e51e by Michael Schonfeld

update tests to use new param name

1 parent ad0e3af6
...@@ -991,14 +991,14 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -991,14 +991,14 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
}) })
}) })
it("should support the insert ignore option", function(done) { it("should support the insert ignoreDuplicates option", function(done) {
var self = this var self = this
, data = [{ uniqueName: 'Peter', secretValue: '42' }, , data = [{ uniqueName: 'Peter', secretValue: '42' },
{ uniqueName: 'Paul', secretValue: '23' }] { uniqueName: 'Paul', secretValue: '23' }]
this.User.bulkCreate(data, { fields: ['uniqueName', 'secretValue'] }).success(function() { this.User.bulkCreate(data, { fields: ['uniqueName', 'secretValue'] }).success(function() {
data.push({ uniqueName: 'Michael', secretValue: '26' }); data.push({ uniqueName: 'Michael', secretValue: '26' });
self.User.bulkCreate(data, { fields: ['uniqueName', 'secretValue'], ignore: true }).success(function() { self.User.bulkCreate(data, { fields: ['uniqueName', 'secretValue'], ignoreDuplicates: true }).success(function() {
self.User.findAll({order: 'id'}).success(function(users) { self.User.findAll({order: 'id'}).success(function(users) {
expect(users.length).to.equal(3) expect(users.length).to.equal(3)
expect(users[0].uniqueName).to.equal("Peter") expect(users[0].uniqueName).to.equal("Peter")
......
...@@ -390,7 +390,7 @@ if (Support.dialectIsMySQL()) { ...@@ -390,7 +390,7 @@ if (Support.dialectIsMySQL()) {
arguments: ['myTable', [{name: "foo", value: true}, {name: 'bar', value: false}]], arguments: ['myTable', [{name: "foo", value: true}, {name: 'bar', value: false}]],
expectation: "INSERT INTO `myTable` (`name`,`value`) VALUES ('foo',true),('bar',false);" expectation: "INSERT INTO `myTable` (`name`,`value`) VALUES ('foo',true),('bar',false);"
}, { }, {
arguments: ['myTable', [{name: 'foo'}, {name: 'bar'}], {ignore: true}], arguments: ['myTable', [{name: 'foo'}, {name: 'bar'}], {ignoreDuplicates: true}],
expectation: "INSERT IGNORE INTO `myTable` (`name`) VALUES ('foo'),('bar');" expectation: "INSERT IGNORE INTO `myTable` (`name`) VALUES ('foo'),('bar');"
} }
], ],
......
...@@ -386,7 +386,7 @@ if (dialect === 'sqlite') { ...@@ -386,7 +386,7 @@ if (dialect === 'sqlite') {
expectation: "INSERT INTO `myTable` (`name`,`foo`,`nullValue`) VALUES ('foo',1,NULL),('bar',2,NULL);", expectation: "INSERT INTO `myTable` (`name`,`foo`,`nullValue`) VALUES ('foo',1,NULL),('bar',2,NULL);",
context: {options: {omitNull: true}} // Note: As above context: {options: {omitNull: true}} // Note: As above
}, { }, {
arguments: ['myTable', [{name: 'foo'}, {name: 'bar'}], {ignore: true}], arguments: ['myTable', [{name: 'foo'}, {name: 'bar'}], {ignoreDuplicates: true}],
expectation: "INSERT OR IGNORE INTO `myTable` (`name`) VALUES ('foo'),('bar');" expectation: "INSERT OR IGNORE INTO `myTable` (`name`) VALUES ('foo'),('bar');"
} }
], ],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!