Permalink
Browse files

added a test for tableName + enabled all tests again

  • Loading branch information...
1 parent ea83dd0 commit 5fa778ea765e05c2eedcd8139487020a453359ad @sdepold committed Dec 28, 2012
Showing with 13 additions and 1 deletion.
  1. +1 −0 changelog.md
  2. +11 −0 spec-jasmine/sequelize.spec.js
  3. +1 −1 spec/migrator.spec.js
View
1 changelog.md
@@ -19,6 +19,7 @@
- [FEATURE] minConnections option for MySQL pooling (thanks to dominiklessel)
- [FEATURE] added BIGINT data type which is treated like a string (thanks to adamsch1)
- [FEATURE] https://github.com/sdepold/sequelize/pull/345
+- [FEATURE] allow definition of a models table name (thanks to slamkajs)
# v1.5.0 #
- [REFACTORING] use underscore functions for Utils.isHash (thanks to Mick-Hansen/innofluence)
View
11 spec-jasmine/sequelize.spec.js
@@ -69,6 +69,17 @@ describe('Sequelize', function() {
expect(typeof DAO.options.classMethods.localClassMethod).toEqual('function')
expect(typeof DAO.options.instanceMethods.globalInstanceMethod).toEqual('function')
})
+
+ it("uses the passed tableName", function(done) {
+ var Photo = sequelize.define('Foto', { name: Sequelize.STRING }, { tableName: 'photos' })
+
+ Photo.sync({ force: true }).success(function() {
+ sequelize.getQueryInterface().showAllTables().success(function(tableNames) {
+ expect(tableNames).toInclude('photos')
+ done
+ })
+ })
+ })
})
describe('sync', function() {
View
2 spec/migrator.spec.js
@@ -10,7 +10,7 @@ if(typeof require === 'function') {
buster.spec.expose()
buster.testRunner.timeout = 1000
-describe('=>'+Helpers.getTestDialectTeaser("Migrator"), function() {
+describe(Helpers.getTestDialectTeaser("Migrator"), function() {
before(function(done) {
this.init = function(options, callback) {
options = Helpers.Sequelize.Utils._.extend({

0 comments on commit 5fa778e

Please sign in to comment.