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

Commit c0d30a27 by Siyang Bi

* Add unit test for #1646

1 parent 530332ae
Showing with 21 additions and 0 deletions
...@@ -1009,6 +1009,27 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -1009,6 +1009,27 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
}) })
}) })
}) })
it('supports table schema/prefix', function(done) {
var self = this
, data = [{ username: 'Peter', secretValue: '42' },
{ username: 'Paul', secretValue: '42' },
{ username: 'Bob', secretValue: '43' }]
, prefixUser = self.User.schema('prefix', '_')
prefixUser.sync({ force: true }).success(function() {
prefixUser.bulkCreate(data).success(function() {
prefixUser.destroy({secretValue: '42'})
.success(function() {
prefixUser.findAll({order: 'id'}).success(function(users) {
expect(users.length).to.equal(1)
expect(users[0].username).to.equal("Bob")
done()
})
})
})
})
})
}) })
describe('equals', function() { describe('equals', function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!