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

Commit dc1930c9 by Sascha Depold

fixed broken mysql spec

1 parent 7e823676
Showing with 24 additions and 24 deletions
...@@ -2400,8 +2400,8 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -2400,8 +2400,8 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
afterEach(function(done) { afterEach(function(done) {
var self = this var self = this
self.sequelize.getQueryInterface().dropTable('posts').success(function() { self.sequelize.getQueryInterface().dropTable('posts', { force: true }).success(function() {
self.sequelize.getQueryInterface().dropTable('authors').success(function() { self.sequelize.getQueryInterface().dropTable('authors', { force: true }).success(function() {
done() done()
}) })
}) })
...@@ -2410,13 +2410,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -2410,13 +2410,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
it('uses an existing dao factory and references the author table', function(done) { it('uses an existing dao factory and references the author table', function(done) {
var self = this var self = this
, Post = this.sequelize.define('post', { , Post = this.sequelize.define('post', {
title: Sequelize.STRING, title: Sequelize.STRING,
authorId: { authorId: {
type: Sequelize.INTEGER, type: Sequelize.INTEGER,
references: this.Author, references: this.Author,
referencesKey: "id" referencesKey: "id"
} }
}) })
this.Author.hasMany(Post) this.Author.hasMany(Post)
Post.belongsTo(this.Author) Post.belongsTo(this.Author)
...@@ -2441,13 +2441,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -2441,13 +2441,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
it('uses a table name as a string and references the author table', function(done) { it('uses a table name as a string and references the author table', function(done) {
var self = this var self = this
, Post = self.sequelize.define('post', { , Post = self.sequelize.define('post', {
title: Sequelize.STRING, title: Sequelize.STRING,
authorId: { authorId: {
type: Sequelize.INTEGER, type: Sequelize.INTEGER,
references: 'authors', references: 'authors',
referencesKey: "id" referencesKey: "id"
} }
}) })
this.Author.hasMany(Post) this.Author.hasMany(Post)
Post.belongsTo(this.Author) Post.belongsTo(this.Author)
...@@ -2472,13 +2472,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -2472,13 +2472,13 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
it("emits an error event as the referenced table name is invalid", function(done) { it("emits an error event as the referenced table name is invalid", function(done) {
var self = this var self = this
, Post = this.sequelize.define('post', { , Post = this.sequelize.define('post', {
title: Sequelize.STRING, title: Sequelize.STRING,
authorId: { authorId: {
type: Sequelize.INTEGER, type: Sequelize.INTEGER,
references: '4uth0r5', references: '4uth0r5',
referencesKey: "id" referencesKey: "id"
} }
}) })
this.Author.hasMany(Post) this.Author.hasMany(Post)
Post.belongsTo(this.Author) Post.belongsTo(this.Author)
...@@ -2495,7 +2495,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -2495,7 +2495,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
} }
}).error(function(err) { }).error(function(err) {
if (dialect === 'mysql') { if (dialect === 'mysql') {
expect(err.message).to.match(/ER_CANNOT_ADD_FOREIGN/) expect(err.message).to.match(/ER_CANT_CREATE_TABLE/)
} }
else if (dialect === 'sqlite') { else if (dialect === 'sqlite') {
// the parser should not end up here ... see above // the parser should not end up here ... see above
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!