Cleaned up QUnit test structure

This commit is contained in:
Robin Ward
2013-06-20 13:58:54 -04:00
parent 0e984762d5
commit 4cd71972be
24 changed files with 83 additions and 87 deletions

View File

@ -0,0 +1,32 @@
// Test helpers
var resolvingPromise = Ember.Deferred.promise(function (p) {
p.resolve();
})
function exists(selector) {
return !!count(selector);
}
function count(selector) {
return find(selector).length;
}
function objBlank(obj) {
if (obj === undefined) return true;
switch (typeof obj) {
case "string":
return obj.trim().length === 0;
case "object":
return $.isEmptyObject(obj);
}
return false;
}
function present(obj, text) {
equal(objBlank(obj), false, text);
}
function blank(obj, text) {
equal(objBlank(obj), true, text);
}