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

Commit d0d4d498 by Sascha Depold

moved specs to buster

1 parent 28840a39
...@@ -285,50 +285,6 @@ describe('DAOFactory', function() { ...@@ -285,50 +285,6 @@ describe('DAOFactory', function() {
}) })
}) })
describe('min', function() {
it("should return the min value", function() {
for(var i = 2; i < 5; i++) Helpers.Factories.User({ age: i })
Helpers.async(function(done) {
User.min('age').on('success', function(min) {
expect(min).toEqual(2); done()
})
})
})
it('allows sql logging', function() {
Helpers.async(function(done) {
User.min('age')
.on('sql', function(sql) {
expect(sql).toBeDefined()
expect(sql.toUpperCase().indexOf("SELECT")).toBeGreaterThan(-1)
done()
})
})
})
})
describe('max', function() {
it("should return the max value", function() {
for(var i = 2; i <= 5; i++) Helpers.Factories.User({ age: i })
Helpers.async(function(done) {
User.max('age').on('success', function(max) {
expect(max).toEqual(5); done()
})
})
})
it('allows sql logging', function() {
Helpers.async(function(done) {
User.max('age')
.on('sql', function(sql) {
expect(sql).toBeDefined()
expect(sql.toUpperCase().indexOf("SELECT")).toBeGreaterThan(-1)
done()
})
})
})
})
describe('equals', function() { describe('equals', function() {
it("correctly determines equality of objects", function() { it("correctly determines equality of objects", function() {
setup({ name: Sequelize.STRING, bio: Sequelize.TEXT }) setup({ name: Sequelize.STRING, bio: Sequelize.TEXT })
......
...@@ -553,14 +553,11 @@ dialects.forEach(function(dialect) { ...@@ -553,14 +553,11 @@ dialects.forEach(function(dialect) {
this.sequelize.sync({ force: true }).success(function() { this.sequelize.sync({ force: true }).success(function() {
this.User.create({ name: 'barfooz' }).success(function(user) { this.User.create({ name: 'barfooz' }).success(function(user) {
this.Task.create({ title: 'task' }).success(function(task) { this.Task.create({ title: 'task' }).success(function(task) {
console.log('task created')
user.setTask(task).success(function() { user.setTask(task).success(function() {
console.log('task set')
this.User.findAll({ this.User.findAll({
where: { 'UserWithNames.id': 1 }, where: { 'UserWithNames.id': 1 },
include: [ 'Task' ] include: [ 'Task' ]
}).success(function(users) { }).success(function(users) {
console.log('boom')
expect(users[0].task).toBeDefined() expect(users[0].task).toBeDefined()
expect(users[0].task.id).toEqual(task.id) expect(users[0].task.id).toEqual(task.id)
done() done()
...@@ -707,5 +704,63 @@ dialects.forEach(function(dialect) { ...@@ -707,5 +704,63 @@ dialects.forEach(function(dialect) {
}) })
} }
}) //- describe: findAll }) //- describe: findAll
describe('min', function() {
before(function(done) {
this.UserWithAge = this.sequelize.define('UserWithAge', {
age: Sequelize.INTEGER
})
this.UserWithAge.sync({ force: true }).success(done)
})
it("should return the min value", function(done) {
this.UserWithAge.create({ age: 2 }).success(function() {
this.UserWithAge.create({ age: 3 }).success(function() {
this.UserWithAge.min('age').success(function(min) {
expect(min).toEqual(2)
done()
})
}.bind(this))
}.bind(this))
})
it('allows sql logging', function(done) {
this.UserWithAge.min('age').on('sql', function(sql) {
expect(sql).toBeDefined()
expect(sql.toUpperCase().indexOf("SELECT")).toBeGreaterThan(-1)
done()
})
})
}) //- describe: min
describe('max', function() {
before(function(done) {
this.UserWithAge = this.sequelize.define('UserWithAge', {
age: Sequelize.INTEGER
})
this.UserWithAge.sync({ force: true }).success(done)
})
it("should return the max value", function(done) {
this.UserWithAge.create({ age: 2 }).success(function() {
this.UserWithAge.create({ age: 3 }).success(function() {
this.UserWithAge.max('age').success(function(max) {
expect(max).toEqual(3)
done()
})
}.bind(this))
}.bind(this))
})
it('allows sql logging', function(done) {
this.UserWithAge.max('age').on('sql', function(sql) {
expect(sql).toBeDefined()
expect(sql.toUpperCase().indexOf("SELECT")).toBeGreaterThan(-1)
done()
})
})
}) //- describe: max
}) })
}) })
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!