Permalink
Browse files

Merge branch 'master' into 19453

  • Loading branch information...
Linda Nichols
Linda Nichols committed Mar 18, 2013
2 parents f974268 + b5042aa commit 27350f6a0cd4719839907ea60368443bdf3f00a7
@@ -67,7 +67,7 @@ white:true*/
}
// Format attribute if it's `HasOne` relation
- if (relation && relation.type === Backbone.HasOne && relation.isNested) {
+ if (relation && relation.type === Backbone.HasOne) { // && relation.isNested) { TODO: Re-add this if we get nonNested back?
klass = XT.getObjectByName(relation.relatedModel);
idAttribute = klass.prototype.idAttribute;
param.attribute = param.attribute + '.' + idAttribute;
@@ -243,13 +243,13 @@ white:true*/
*/
resetPassword: function (id, options) {
var payload = {
- id: id
- },
- ajax = new enyo.Ajax({
- url: "/resetPassword",
- success: options ? options.success : undefined,
- error: options ? options.error : undefined
- });
+ id: id
+ },
+ ajax = new enyo.Ajax({
+ url: "/resetPassword",
+ success: options ? options.success : undefined,
+ error: options ? options.error : undefined
+ });
if (options.newUser) {
// we don't want to send false at all, because false turns
@@ -269,14 +269,14 @@ white:true*/
*/
changePassword: function (params, options) {
var payload = {
- oldPassword: params.oldPassword,
- newPassword: params.newPassword
- },
- ajax = new enyo.Ajax({
- url: "/changePassword",
- success: options ? options.success : undefined,
- error: options ? options.error : undefined
- });
+ oldPassword: params.oldPassword,
+ newPassword: params.newPassword
+ },
+ ajax = new enyo.Ajax({
+ url: "/changePassword",
+ success: options ? options.success : undefined,
+ error: options ? options.error : undefined
+ });
ajax.response(this.ajaxSuccess);
ajax.go(payload);
@@ -313,10 +313,10 @@ white:true*/
*/
sendEmail: function (payload, options) {
var ajax = new enyo.Ajax({
- url: "/email",
- success: options ? options.success : undefined,
- error: options ? options.error : undefined
- });
+ url: "/email",
+ success: options ? options.success : undefined,
+ error: options ? options.error : undefined
+ });
if (payload.body && !payload.text) {
// be flexible with the inputs. Node-emailer prefers the term text, but
@@ -337,10 +337,10 @@ white:true*/
*/
getExtensionList: function (options) {
var ajax = new enyo.Ajax({
- url: "/extensions",
- success: options ? options.success : undefined,
- error: options ? options.error : undefined
- });
+ url: "/extensions",
+ success: options ? options.success : undefined,
+ error: options ? options.error : undefined
+ });
ajax.response(this.ajaxSuccess);
ajax.go();
@@ -38,7 +38,7 @@ white:true*/
@extends XM.Document
*/
- XM.ItemSite = XM.Document.extend(/** @lends XM.ItemSite.prototype */{
+ XM.ItemSite = XM.Model.extend(/** @lends XM.ItemSite.prototype */{
recordType: 'XM.ItemSite',
@@ -48,7 +48,6 @@ white:true*/
requiredAttributes: [
"id",
- "number",
"plannerCode",
"costCategory"
]
@@ -29,8 +29,7 @@ regexp:true, undef:true, trailing:true, white:true */
nameAttribute: "jobTitle",
descripAttribute: "phone",
published: {
- showAddress: false,
- account: null
+ showAddress: false
},
filterRestrictionType: ["account", "accountParent"],
components: [
@@ -992,8 +992,8 @@
"properties": [
{
"name": "accountParent",
- "toOne": {
- "type": "AccountRelation",
+ "attr": {
+ "type": "Number",
"column": "crmacct_parent_id"
}
}
@@ -1142,8 +1142,8 @@
"properties": [
{
"name": "accountParent",
- "toOne": {
- "type": "AccountRelation",
+ "attr": {
+ "type": "Number",
"column": "crmacct_parent_id"
}
}
@@ -157,7 +157,7 @@ white:true*/
canDelete: function () {
return this.getClass().canDelete(this);
},
-
+
/**
Oveload: make sure `silent` changes never fire. Backbone .9.10 behaves
this way anyway, so this should be removed at the next upgrade.
@@ -1214,7 +1214,8 @@ white:true*/
keys = _.keys(attributes),
original = _.pick(this.originalAttributes(), keys),
status = this.getStatus(),
- attr, value, category, column, params = {},
+ attr, value, category, column,
+ params = {recordType: this.recordType},
type = this.recordType.replace(/\w+\./i, ''),
columns = XT.session.getSchema().get(type).columns,
isRel,
@@ -60,10 +60,10 @@ var _ = require("underscore"),
that.callback(null, data);
}, exports.waitTime);
},
- 'Status is `READY_NEW`': function (data) {
+ 'Status is `READY_NEW`': function (error, data) {
assert.equal(data.model.getStatusString(), 'READY_NEW');
},
- 'ID is valid': function (data) {
+ 'ID is valid': function (error, data) {
assert.isNumber(data.model.id);
}
};
@@ -109,6 +109,9 @@ var _ = require("underscore"),
assert.equal(data.model.getStatusString(), 'READY_CLEAN');
},
'And the values are as we set them': function (error, data) {
+ if (!data.autoTestAttributes) {
+ return;
+ }
var hashToTest = data.updated ? _.extend(data.createHash, data.updateHash) : data.createHash;
_.each(hashToTest, function (value, key) {
// depending on how we represent sub-objects, we want to verify them in different ways
@@ -78,8 +78,14 @@ Simplest possible usage:
}
host = host || "https://localhost:443";
-
-
+ // when we run all our tests we only want to have to log in for the first one
+ if (XT.app) {
+ if (verboseMode) {
+ console.log("Using pre-existing zombie session");
+ }
+ callback(); // TODO: callback(XZ.browser);
+ return;
+ }
zombie.visit(host, {debug: false}, function (e, browser) {
//
@@ -117,9 +123,9 @@ Simplest possible usage:
XT = browser.window.XT;
XV = browser.window.XV;
- //TODO: improve error reporting
- XT.log = function () {
- if (verboseMode) {
+ XT.log = function (message) {
+ // log if verbose mode or if the log is an error
+ if (verboseMode || (message && message.code)) {
console.log(JSON.stringify(arguments));
}
};
@@ -14,6 +14,8 @@ var XVOWS = XVOWS || {};
var data = {};
+ data.autoTestAttributes = true;
+
data.createHash = {
item: {id: 333},
site: {id: 37}, // NOTE the item and site have to be a combo that doesn't yet exist
@@ -34,9 +36,9 @@ var XVOWS = XVOWS || {};
data.model = new XM.ItemSite();
that.callback(null, data);
};
- zombieAuth.loadApp(callback);
+ zombieAuth.loadApp({callback: callback, verbose: false});
},
- 'The record type is XM.ItemSite': function (data) {
+ 'The record type is XM.ItemSite': function (error, data) {
assert.equal(data.model.recordType, "XM.ItemSite");
}
}
@@ -60,21 +62,15 @@ var XVOWS = XVOWS || {};
},
'ID is a number': function (data) {
assert.isNumber(data.model.id);
- },
- 'isSold is true': function (data) {
- assert.equal(data.model.get('isSold'), data.createHash.isSold);
}
}
}).addBatch({
'UPDATE ': crud.update(data, {
'-> Set values': {
- topic: function () {
+ topic: function (data) {
data.model.set(data.updateHash);
return data;
},
- 'isSold is false': function (data) {
- assert.equal(data.model.get('isSold'), data.updateHash.isSold);
- },
'-> Commit': crud.save(data)
}
})

0 comments on commit 27350f6

Please sign in to comment.