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

Commit 550b40bc by Mick Hansen

fix tests that i broke

1 parent 0f4a7b42
...@@ -1263,6 +1263,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () { ...@@ -1263,6 +1263,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () {
beforeUpdate: function(attributes, options, fn) { beforeUpdate: function(attributes, options, fn) {
beforeHook = true beforeHook = true
attributes.mood = 'happy' attributes.mood = 'happy'
options.fields.push('mood');
fn() fn()
}, },
afterUpdate: function(attributes, options, fn) { afterUpdate: function(attributes, options, fn) {
...@@ -1303,6 +1304,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () { ...@@ -1303,6 +1304,7 @@ describe(Support.getTestDialectTeaser("Hooks"), function () {
function(attributes, options, fn) { function(attributes, options, fn) {
beforeHook = true beforeHook = true
attributes.mood = 'joyful' attributes.mood = 'joyful'
options.fields.push('mood');
fn() fn()
}, },
function(attributes, options, fn) { function(attributes, options, fn) {
......
...@@ -818,7 +818,7 @@ if (dialect.match(/^postgres/)) { ...@@ -818,7 +818,7 @@ if (dialect.match(/^postgres/)) {
expectation: "DELETE FROM \"mySchema\".\"myTable\" WHERE \"id\" IN (SELECT \"id\" FROM \"mySchema\".\"myTable\" WHERE \"name\"='foo'';DROP TABLE mySchema.myTable;' LIMIT 10)" expectation: "DELETE FROM \"mySchema\".\"myTable\" WHERE \"id\" IN (SELECT \"id\" FROM \"mySchema\".\"myTable\" WHERE \"name\"='foo'';DROP TABLE mySchema.myTable;' LIMIT 10)"
}, { }, {
arguments: ['myTable', {name: 'foo'}, {limit: null}], arguments: ['myTable', {name: 'foo'}, {limit: null}],
expectation: "DELETE FROM \"myTable\" WHERE \"id\" IN (SELECT \"id\" FROM \"myTable\" WHERE \"name\"='foo')" expectation: "DELETE FROM \"myTable\" WHERE \"name\"='foo'"
}, },
// Variants when quoteIdentifiers is false // Variants when quoteIdentifiers is false
...@@ -848,7 +848,7 @@ if (dialect.match(/^postgres/)) { ...@@ -848,7 +848,7 @@ if (dialect.match(/^postgres/)) {
context: {options: {quoteIdentifiers: false}} context: {options: {quoteIdentifiers: false}}
}, { }, {
arguments: ['myTable', {name: 'foo'}, {limit: null}], arguments: ['myTable', {name: 'foo'}, {limit: null}],
expectation: "DELETE FROM myTable WHERE id IN (SELECT id FROM myTable WHERE name='foo')", expectation: "DELETE FROM myTable WHERE name='foo'",
context: {options: {quoteIdentifiers: false}} context: {options: {quoteIdentifiers: false}}
} }
], ],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!