Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #61 from xtuple/master

catching up
  • Loading branch information...
commit 44dcd84dbcb726f076b430f95856aa4ca5c83fac 2 parents a3fe153 + 0d16105
@mikerodonnell89 authored
View
4 node-datasource/routes/maintenance.js
@@ -145,7 +145,7 @@ regexp:true, undef:true, strict:true, trailing:true, white:true */
// on the organization collection
//
fetchSuccess = function (collection, response) {
- _.each(collection, function (org) {
+ _.each(response, function (org, index) {
var scriptName = "init_script.sql",
host = org.databaseServer.hostname,
port = org.databaseServer.port,
@@ -209,7 +209,7 @@ regexp:true, undef:true, strict:true, trailing:true, white:true */
ormArray.push({ormCreds: ormCreds, ormDir: coreOrmDir, loadOrder: -9990});
}
- _.each(org.get("extensions"), function (ext) {
+ _.each(org.extensions, function (ext) {
//
// go through all of the extensions of all the organizations...
//
View
103 node-datasource/test/vows/models/sales_rep.js
@@ -8,20 +8,97 @@ var XVOWS = XVOWS || {};
"use strict";
var vows = require("vows"),
- crud = require('../lib/crud'),
- data = {
- recordType: "XM.SalesRep",
- autoTestAttributes: true,
- createHash: {
- number: "rep"
- },
- updateHash: {
- number: "updatedRep"
- }
- };
+ assert = require("assert"),
+ zombieAuth = require("../lib/zombie_auth"),
+ crud = require('../lib/crud');
+
+ var data = {},
+ deleteData = {};
+
+ data.createHash = {
+ number: "TESTSALESREP",
+ name: "TestRep"
+ };
+
+ data.updateHash = {
+ name: "Updated Test SalesRep"
+ };
vows.describe('XM.SalesRep CRUD test').addBatch({
- 'We can run the XM.SalesRep CRUD tests ': crud.runAllCrud(data)
+ 'INITIALIZE ': {
+ topic: function () {
+ var that = this,
+ callback = function () {
+ data.model = new XM.SalesRep();
+ that.callback(null, data);
+ };
+ zombieAuth.loadApp(callback);
+ },
+ 'The record type is XM.SalesRep': function (data) {
+ assert.equal(data.model.recordType, "XM.SalesRep");
+ }
+ }
+ }).addBatch({
+ 'CREATE ': crud.create(data, {
+ '-> Set values': {
+ topic: function (data) {
+ data.model.set(data.createHash);
+ return data;
+ },
+ 'Last Error is null': function (data) {
+ assert.isNull(data.model.lastError);
+ },
+ '-> Save': crud.save(data)
+ }
+ })
+ }).addBatch({
+ 'READ': {
+ topic: function () {
+ return data;
+ },
+ 'ID is a number': function (data) {
+ assert.isNumber(data.model.id);
+ }
+ }
+ }).addBatch({
+ 'UPDATE ': crud.update(data, {
+ '-> Set values': {
+ topic: function () {
+ deleteData.accntId = data.model.get("account").get("id");
+ deleteData.accountModel = new XM.Account();
+ data.model.set(data.updateHash);
+ return data;
+ },
+ 'Name is `Updated Test SalesRep`': function (data) {
+ assert.equal(data.model.get('name'), data.updateHash.name);
+ },
+ '-> Commit': crud.save(data)
+ }
+ })
+ }).addBatch({
+ 'DESTROY': crud.destroy(data, {
+ '-> Set values': {
+ //Destroy the SalesRep. When that is successful, destroy the account
+ 'SalesRep destroyed': function (data) {
+ assert.isTrue(data.model.getStatus() === XM.Model.DESTROYED_CLEAN);
+ },
+ topic: function () {
+ var that = this,
+ fetchOptionsAccnt = {};
+
+ fetchOptionsAccnt.id = deleteData.accntId;
+
+ fetchOptionsAccnt.success = function () {
+ var destroyOptionsAccnt = {};
+ destroyOptionsAccnt.success = function () {
+ that.callback(null, data);
+ };
+ deleteData.accountModel.destroy(destroyOptionsAccnt);
+ };
+ deleteData.accountModel.fetch(fetchOptionsAccnt);
+ }
+ }
+ })
}).export(module);
-
+
}());
View
2  update.sh
@@ -73,7 +73,7 @@ monit start node
sleep 10
# update global db
-cd database/source
+cd node-datasource/database/source
psql -U admin -h $HOST global -f init_global.sql
cd ../../installer
./installer.js -h $HOST -d global -u admin -p 5432 -P admin --path ../database/orm
Please sign in to comment.
Something went wrong with that request. Please try again.