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

Commit 058d0b1c by Sascha Depold

added failing test for values out of enum range

1 parent 3836db40
......@@ -25,7 +25,7 @@ describe('QueryGenerator', function() {
},
{
arguments: ['myTable', {title: 'ENUM("A", "B", "C")', name: 'VARCHAR(255)'}],
expectation: "CREATE TYPE \"enum_myTable_title\" AS ENUM(\"A\", \"B\", \"C\"); CREATE TABLE IF NOT EXISTS \"myTable\" (\"title\" \"enum_myTable_title\", \"name\" VARCHAR(255));"
expectation: "DROP TYPE IF EXISTS \"enum_myTable_title\"; CREATE TYPE \"enum_myTable_title\" AS ENUM(\"A\", \"B\", \"C\"); CREATE TABLE IF NOT EXISTS \"myTable\" (\"title\" \"enum_myTable_title\", \"name\" VARCHAR(255));"
}
],
......
......@@ -6,10 +6,12 @@ if(typeof require === 'function') {
}
var qq = function(str) {
if (dialect == 'postgres')
return '"' + str + '"';
return str;
};
if (dialect == 'postgres') {
return '"' + str + '"'
} else {
return str
}
}
buster.spec.expose()
......@@ -140,6 +142,13 @@ describe(Helpers.getTestDialectTeaser("Sequelize"), function() {
})
}.bind(this))
})
itEventually("doesn't save an instance if value is not in the range of enums", function(done) {
this.Review.create({ status: 'fnord' }).error(function(err) {
expect(1).toEqual(1)
done()
})
})
})
})
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!