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

Commit 338c1e05 by Mick Hansen

Merge pull request #1921 from thanpolas/spaces-on-save

auto-trim-trailing-whitespace
2 parents f949b7ec 1986e98e
Showing with 7 additions and 7 deletions
...@@ -570,7 +570,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -570,7 +570,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
User.build({ name : "error" }).validate().success(function(error) { User.build({ name : "error" }).validate().success(function(error) {
expect(error).to.be.an.instanceOf(self.sequelize.ValidationError) expect(error).to.be.an.instanceOf(self.sequelize.ValidationError)
expect(error.name[0].message).to.equal("Invalid username") expect(error.name[0].message).to.equal("Invalid username")
User.build({ name : "no error" }).validate().success(function(errors) { User.build({ name : "no error" }).validate().success(function(errors) {
expect(errors).not.to.be.defined expect(errors).not.to.be.defined
done() done()
...@@ -578,7 +578,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -578,7 +578,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' + config.rand(), { var User = this.sequelize.define('User' + config.rand(), {
age: { age: {
...@@ -755,7 +755,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -755,7 +755,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
} }
} }
}) })
User.sync({force: true}).success(function() { User.sync({force: true}).success(function() {
User.create({ name: "RedCat" }).success(function(user){ User.create({ name: "RedCat" }).success(function(user){
expect(user.getDataValue('name')).to.equal('RedCat') expect(user.getDataValue('name')).to.equal('RedCat')
...@@ -770,7 +770,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -770,7 +770,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
}) })
}) })
}) })
it("allows setting an immutable field if the record is unsaved", function(done) { it("allows setting an immutable field if the record is unsaved", function(done) {
var User = this.sequelize.define('User', { var User = this.sequelize.define('User', {
name: { name: {
...@@ -780,10 +780,10 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -780,10 +780,10 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
} }
} }
}) })
var user = User.build({ name: "RedCat" }) var user = User.build({ name: "RedCat" })
expect(user.getDataValue('name')).to.equal('RedCat') expect(user.getDataValue('name')).to.equal('RedCat')
user.setDataValue('name','YellowCat') user.setDataValue('name','YellowCat')
user.validate().success(function(errors) { user.validate().success(function(errors) {
expect(errors).not.to.be.ok expect(errors).not.to.be.ok
...@@ -844,7 +844,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -844,7 +844,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
type: Sequelize.VIRTUAL, type: Sequelize.VIRTUAL,
set: function (val) { set: function (val) {
this.setDataValue('password', val); this.setDataValue('password', val);
this.setDataValue('password_hash', this.salt + val); this.setDataValue('password_hash', this.salt + val);
}, },
validate: { validate: {
isLongEnough: function (val) { isLongEnough: function (val) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!