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

Commit a73c5a28 by sdepold

merge create specs with existing

1 parent a8f36f93
Showing with 15 additions and 17 deletions
......@@ -143,6 +143,21 @@ describe('ModelFactory', function() {
})
})
})
it('allows the usage of options as attribute', function() {
setup({ name: Sequelize.STRING, options: Sequelize.TEXT })
Helpers.async(function(done) {
var options = JSON.stringify({ foo: 'bar', bar: 'foo' })
User
.create({ name: 'John Doe', options: options })
.success(function(user) {
expect(user.options).toEqual(options)
done()
})
})
})
})
describe('destroy', function() {
......@@ -220,23 +235,6 @@ describe('ModelFactory', function() {
})
})
describe('create with options', function() {
var Person = sequelize.define('Person', { name: Sequelize.STRING, options: Sequelize.TEXT })
beforeEach(function() {
Helpers.async(function(done) {
Person.sync({ force: true }).success(done)
})
})
it('should allow the creation of an object with options as attribute', function() {
var options = JSON.stringify({ foo: 'bar', bar: 'foo' })
Helpers.Factories.Model('Person', {name: 'John Doe', options: options}, function(people) {
expect(people[0].options).toEqual(options)
})
})
})
describe('count', function() {
it('counts all created objects', function() {
Helpers.async(function(done) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!