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

Commit 056d4f49 by Daniel Durante

Swapped Math.random() for config.rand(). It's more in line with the tests' gener…

…al style, and removes decimal points in table names.
1 parent f67be432
Showing with 7 additions and 5 deletions
...@@ -2,6 +2,7 @@ var chai = require('chai') ...@@ -2,6 +2,7 @@ var chai = require('chai')
, expect = chai.expect , expect = chai.expect
, Sequelize = require(__dirname + '/../index') , Sequelize = require(__dirname + '/../index')
, Support = require(__dirname + '/support') , Support = require(__dirname + '/support')
, config = require(__dirname + '/config/config')
chai.Assertion.includeStack = true chai.Assertion.includeStack = true
...@@ -203,7 +204,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -203,7 +204,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
validations[validator].msg = message validations[validator].msg = message
var UserFail = this.sequelize.define('User' + Math.random(), { var UserFail = this.sequelize.define('User' + config.rand(), {
name: { name: {
type: Sequelize.STRING, type: Sequelize.STRING,
validate: validations validate: validations
...@@ -222,6 +223,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -222,6 +223,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
//////////////////////////// ////////////////////////////
// test the success cases // // test the success cases //
//////////////////////////// ////////////////////////////
for (var j = 0; j < validatorDetails.pass.length; j++) { for (var j = 0; j < validatorDetails.pass.length; j++) {
var succeedingValue = validatorDetails.pass[j] var succeedingValue = validatorDetails.pass[j]
...@@ -236,7 +238,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -236,7 +238,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
validations[validator].msg = validator + "(" + succeedingValue + ")" validations[validator].msg = validator + "(" + succeedingValue + ")"
var UserSuccess = this.sequelize.define('User' + Math.random(), { var UserSuccess = this.sequelize.define('User' + config.rand(), {
name: { name: {
type: Sequelize.STRING, type: Sequelize.STRING,
validate: validations validate: validations
...@@ -252,7 +254,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -252,7 +254,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
} }
it('correctly validates using custom validation methods', function(done) { it('correctly validates using custom validation methods', function(done) {
var User = this.sequelize.define('User' + Math.random(), { var User = this.sequelize.define('User' + config.rand(), {
name: { name: {
type: Sequelize.STRING, type: Sequelize.STRING,
validate: { validate: {
...@@ -278,7 +280,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -278,7 +280,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
}) })
it('skips other validations if allowNull is true and the value is null', function(done) { it('skips other validations if allowNull is true and the value is null', function(done) {
var User = this.sequelize.define('User' + Math.random(), { var User = this.sequelize.define('User' + config.rand(), {
age: { age: {
type: Sequelize.INTEGER, type: Sequelize.INTEGER,
allowNull: true, allowNull: true,
...@@ -304,7 +306,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -304,7 +306,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
}) })
it('validates a model with custom model-wide validation methods', function(done) { it('validates a model with custom model-wide validation methods', function(done) {
var Foo = this.sequelize.define('Foo' + Math.random(), { var Foo = this.sequelize.define('Foo' + config.rand(), {
field1: { field1: {
type: Sequelize.INTEGER, type: Sequelize.INTEGER,
allowNull: true allowNull: true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!