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

Commit 87dbb148 by Meg Sharkey

added test

1 parent d8cfd984
{
"name": "sequelize",
"description": "MySQL ORM for Node.JS",
"version": "1.2.0",
"author": "Sascha Depold <sascha@depold.com>",
"name": "sqlize",
"description": "Modified version of sequelize - MySQL ORM for Node.JS",
"version": "0.1.0",
"author": "Meg Sharkey <meg@metamx.com>",
"contributors": [
{ "name": "Sascha Depold", "email": "sascha@depold.com" }
{ "name": "Sascha Depold", "email": "sascha@depold.com" },
{ "name": "Meg Sharkey", "email": "meg@metamx.com" }
],
"dependencies": {
"mysql": "=0.9.4",
......@@ -16,7 +17,7 @@
"jasmine-node": "=1.0.12",
"expresso": "=0.9.2"
},
"keywords": ["mysql", "orm", "nodejs", "object relational mapper"],
"keywords": [],
"main": "index",
"scripts": {},
"bin": {},
......
......@@ -21,7 +21,20 @@ describe('Associations', function() {
expect(sequelize.modelManager.getModel('wp_table1swp_table2s')).toBeDefined()
})
})
// TODO add test for specifying join table name
describe('when join table name is specified', function() {
var Table2 = sequelize.define('ms_table1', {foo: Sequelize.STRING})
, Table1 = sequelize.define('ms_table2', {foo: Sequelize.STRING})
Table1.hasMany(Table2, {joinTableName: 'table1_to_table2'})
Table2.hasMany(Table1, {joinTableName: 'table1_to_table2'})
it("should not use a combined name", function() {
expect(sequelize.modelManager.getModel('ms_table1sms_table2s')).toBeUndefined()
})
it("should use the specified name", function() {
expect(sequelize.modelManager.getModel('table1_to_table2')).toBeDefined()
})
})
})
})
module.exports = {
username: "root",
password: null,
database: 'sequelize_test',
username: "meg",
password: "meg",
database: 'test',
host: '127.0.0.1',
rand: function() {
return parseInt(Math.random() * 999)
......
module.exports = {
username: "root",
password: null,
database: 'sequelize_test',
username: "meg",
password: "meg",
database: 'test',
host: '127.0.0.1',
rand: function() {
return parseInt(Math.random() * 999)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!