Skip to content

Commit

Permalink
Merge pull request #710 from bitovi/live-binding-truthy-section
Browse files Browse the repository at this point in the history
Live binding attribute in a truthy section does not work
  • Loading branch information
justinbmeyer committed Jan 31, 2014
2 parents df4d45d + 4f8520b commit 6299c1c
Show file tree
Hide file tree
Showing 34 changed files with 504 additions and 481 deletions.
2 changes: 1 addition & 1 deletion component/component_test.js
@@ -1,4 +1,4 @@
steal("can/component", function(){
steal("can/component", function () {
module('can/component', {
setup: function () {
can.remove(can.$('#qunit-test-area>*'));
Expand Down
2 changes: 1 addition & 1 deletion compute/compute_test.js
@@ -1,4 +1,4 @@
steal("can/compute", "can/test", function() {
steal("can/compute", "can/test", function () {
module('can/compute');
test('single value compute', function () {
var num = can.compute(1);
Expand Down
2 changes: 1 addition & 1 deletion construct/construct_test.js
@@ -1,4 +1,4 @@
steal('can/construct', function() {
steal('can/construct', function () {
/* global Foo, Car, Bar */
module('can/construct', {
setup: function () {
Expand Down
2 changes: 1 addition & 1 deletion construct/proxy/proxy_test.js
@@ -1,4 +1,4 @@
steal("can/construct/proxy", "can/control", function() {
steal("can/construct/proxy", "can/control", function () {
/* global Car */
var isSteal = typeof steal !== 'undefined';
module('can/construct/proxy');
Expand Down
2 changes: 1 addition & 1 deletion construct/super/super_test.js
@@ -1,4 +1,4 @@
steal("can/construct/super", function() {
steal("can/construct/super", function () {
module('can/construct/super');
test('prototype super', function () {
var A = can.Construct({
Expand Down
14 changes: 7 additions & 7 deletions control/control_test.js
Expand Up @@ -230,8 +230,8 @@ steal("can/control", function () {
}
});
var item1 = bindable({
id: 1
}),
id: 1
}),
item2 = bindable({
id: 2
}),
Expand Down Expand Up @@ -278,11 +278,11 @@ steal("can/control", function () {
});
test('Multiple calls to destroy', 2, function () {
var Control = can.Control({
destroy: function () {
ok(true);
can.Control.prototype.destroy.call(this);
}
}),
destroy: function () {
ok(true);
can.Control.prototype.destroy.call(this);
}
}),
div = document.createElement('div'),
c = new Control(div);
c.destroy();
Expand Down
2 changes: 1 addition & 1 deletion control/modifier/modifier_test.js
@@ -1,5 +1,5 @@
steal('can/util', 'can/control/modifier', function (can) {
if(!window.jQuery) {
if (!window.jQuery) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions control/plugin/plugin_test.js
@@ -1,5 +1,5 @@
steal("can/control/plugin", function() {
if(!window.jQuery) {
steal("can/control/plugin", function () {
if (!window.jQuery) {
return;
}

Expand Down
20 changes: 10 additions & 10 deletions list/list_test.js
@@ -1,4 +1,4 @@
steal("can/util", "can/list", "can/test", function() {
steal("can/util", "can/list", "can/test", function () {
module('can/list');
test('list attr changes length', function () {
var l = new can.List([
Expand All @@ -11,11 +11,11 @@ steal("can/util", "can/list", "can/test", function() {
});
test('list splice', function () {
var l = new can.List([
0,
1,
2,
3
]),
0,
1,
2,
3
]),
first = true;
l.bind('change', function (ev, attr, how, newVals, oldVals) {
equal(attr, '1');
Expand Down Expand Up @@ -128,10 +128,10 @@ steal("can/util", "can/list", "can/test", function() {
});
test('Array accessor methods', 11, function () {
var l = new can.List([
'a',
'b',
'c'
]),
'a',
'b',
'c'
]),
sliced = l.slice(2),
joined = l.join(' | '),
concatenated = l.concat([
Expand Down
14 changes: 7 additions & 7 deletions map/attributes/attributes_test.js
@@ -1,5 +1,5 @@
/*jshint undef:false,unused:false*/
steal("can/map/attributes", "can/model", "can/util/fixture", "can/test", function() {
steal("can/map/attributes", "can/model", "can/util/fixture", "can/test", function () {
module('can/map/attributes');
test('literal converters and serializes', function () {
can.Map('Task1', {
Expand Down Expand Up @@ -307,12 +307,12 @@ steal("can/map/attributes", "can/model", "can/util/fixture", "can/test", functio
});
test('Default converters and boolean fix (#247)', function () {
var MyObserve = can.Map({
attributes: {
enabled: 'boolean',
time: 'date',
age: 'number'
}
}, {}),
attributes: {
enabled: 'boolean',
time: 'date',
age: 'number'
}
}, {}),
obs = new MyObserve({
enabled: 'false',
time: 1358980553275,
Expand Down
2 changes: 1 addition & 1 deletion map/backup/backup_test.js
@@ -1,5 +1,5 @@
/*global Recipe*/
steal("can/map/backup", "can/model", "can/test", function() {
steal("can/map/backup", "can/model", "can/test", function () {
module('can/map/backup', {
setup: function () {
can.Map.extend('Recipe');
Expand Down
14 changes: 7 additions & 7 deletions map/delegate/delegate_test.js
@@ -1,4 +1,4 @@
steal("can/map/delegate", "can/test", function() {
steal("can/map/delegate", "can/test", function () {
module('can/map/delegate');
var matches = can.Map.prototype.delegate.matches;
test('matches', function () {
Expand Down Expand Up @@ -158,12 +158,12 @@ steal("can/map/delegate", "can/test", function() {
var f1 = function () {
state.undelegate('type', 'add', f2);
}, f2 = function () {
ok(false, 'I am removed, how am I called');
}, f3 = function () {
state.undelegate('type', 'add', f1);
}, f4 = function () {
ok(true, 'f4 called');
};
ok(false, 'I am removed, how am I called');
}, f3 = function () {
state.undelegate('type', 'add', f1);
}, f4 = function () {
ok(true, 'f4 called');
};
state.delegate('type', 'set', f1);
state.delegate('type', 'set', f2);
state.delegate('type', 'set', f3);
Expand Down
2 changes: 1 addition & 1 deletion map/list/list_test.js
@@ -1,4 +1,4 @@
steal("can/map/list", function(){
steal("can/map/list", function () {
module('can/map/list');
test('filter', 8, function () {
var original = new can.List([{
Expand Down
2 changes: 1 addition & 1 deletion map/map_test.js
@@ -1,5 +1,5 @@
/* jshint asi:true*/
steal("can/map", "can/compute", "can/test", function(undefined) {
steal("can/map", "can/compute", "can/test", function (undefined) {

module('can/map')

Expand Down
2 changes: 1 addition & 1 deletion map/setter/setter_test.js
@@ -1,5 +1,5 @@
/*global School*/
steal("can/map/setter", "can/test", function() {
steal("can/map/setter", "can/test", function () {
module('can/map/setter');
test('setter testing works', function () {
var Contact = can.Map({
Expand Down
2 changes: 1 addition & 1 deletion map/sort/sort_test.js
@@ -1,4 +1,4 @@
steal("can/map/sort", "can/test", "can/view/mustache", function() {
steal("can/map/sort", "can/test", "can/view/mustache", function () {
module('can/map/sort');
test('list events', 16, function () {
var list = new can.List([{
Expand Down
40 changes: 20 additions & 20 deletions map/validations/validations_test.js
@@ -1,5 +1,5 @@
/*global Person,Task*/
steal("can/map/validations", "can/compute", "can/test", function() {
steal("can/map/validations", "can/compute", "can/test", function () {
module('can/map/validations', {
setup: function () {
can.Map.extend('Person', {}, {});
Expand All @@ -12,8 +12,8 @@ steal("can/map/validations", "can/compute", "can/test", function() {
return !(this.date instanceof Date);
});
var task = new Person({
age: 'bad'
}),
age: 'bad'
}),
errors = task.errors();
ok(errors, 'There are errors');
equal(errors.age.length, 1, 'there is one error');
Expand All @@ -31,8 +31,8 @@ steal("can/map/validations", "can/compute", "can/test", function() {
test('validatesFormatOf', function () {
Person.validateFormatOf('thing', /\d-\d/);
ok(!new Person({
thing: '1-2'
})
thing: '1-2'
})
.errors(), 'no errors');
var errors = new Person({
thing: 'foobar'
Expand All @@ -51,13 +51,13 @@ steal("can/map/validations", "can/compute", "can/test", function() {
.errors();
equal(errors2.otherThing[0], 'not a digit', 'can supply a custom message');
ok(!new Person({
thing: '1-2',
otherThing: null
})
thing: '1-2',
otherThing: null
})
.errors(), 'can handle null');
ok(!new Person({
thing: '1-2'
})
thing: '1-2'
})
.errors(), 'can handle undefiend');
});
test('validatesInclusionOf', function () {
Expand All @@ -67,8 +67,8 @@ steal("can/map/validations", "can/compute", "can/test", function() {
'maybe'
]);
ok(!new Person({
thing: 'yes'
})
thing: 'yes'
})
.errors(), 'no errors');
var errors = new Person({
thing: 'foobar'
Expand Down Expand Up @@ -96,9 +96,9 @@ steal("can/map/validations", "can/compute", "can/test", function() {
Person.validateLengthOf('nullValue', 0, 5);
Person.validateLengthOf('thing', 2, 5);
ok(!new Person({
thing: 'yes',
nullValue: null
})
thing: 'yes',
nullValue: null
})
.errors(), 'no errors');
var errors = new Person({
thing: 'foobar'
Expand Down Expand Up @@ -219,9 +219,9 @@ steal("can/map/validations", "can/compute", "can/test", function() {
Person.validateRangeOf('nullValue', 0, 5);
Person.validateRangeOf('undefinedValue', 0, 5);
ok(!new Person({
thing: 4,
nullValue: null
})
thing: 4,
nullValue: null
})
.errors(), 'no errors');
var errors = new Person({
thing: 6
Expand Down Expand Up @@ -331,8 +331,8 @@ steal("can/map/validations", "can/compute", "can/test", function() {
return !(this.date instanceof Date);
});
var task = new Person({
age: 20
}),
age: 20
}),
errors = can.compute(function () {
return task.errors();
});
Expand Down
52 changes: 26 additions & 26 deletions model/model_test.js
Expand Up @@ -8,7 +8,7 @@
/* global Product: true */
/* global Organisation: true */
/* global Company: true */
steal("can/model",'can/map/attributes', "can/test", "can/util/fixture", function() {
steal("can/model", 'can/map/attributes', "can/test", "can/util/fixture", function () {
module('can/model', {
setup: function () {}
});
Expand Down Expand Up @@ -209,8 +209,8 @@ steal("can/model",'can/map/attributes', "can/test", "can/util/fixture", function
}
}, {});
var person = new Person({
name: 'Justin'
}),
name: 'Justin'
}),
personD = person.save();
stop();
personD.then(function (person) {
Expand All @@ -236,9 +236,9 @@ steal("can/model",'can/map/attributes', "can/test", "can/util/fixture", function
}
}, {});
var person = new Person({
name: 'Justin',
id: 5
}),
name: 'Justin',
id: 5
}),
personD = person.save();
stop();
personD.then(function (person) {
Expand All @@ -263,9 +263,9 @@ steal("can/model",'can/map/attributes', "can/test", "can/util/fixture", function
}
}, {});
var person = new Person({
name: 'Justin',
id: 5
}),
name: 'Justin',
id: 5
}),
personD = person.destroy();
stop();
personD.then(function (person) {
Expand Down Expand Up @@ -650,8 +650,8 @@ steal("can/model",'can/map/attributes', "can/test", "can/util/fixture", function
});
stop();
can.when(Guy.findOne({
id: 1
}), Guy.findAll())
id: 1
}), Guy.findAll())
.then(function (guyRes, guysRes2) {
equal(guyRes.id, 1, 'got a guy id 1 back');
equal(guysRes2[0].id, 1, 'got guys w/ id 1 back');
Expand Down Expand Up @@ -907,13 +907,13 @@ steal("can/model",'can/map/attributes', "can/test", "can/util/fixture", function
}
}, {});
var people = new Person.List([
new Person({
id: 1
}),
new Person({
id: 2
})
]),
new Person({
id: 1
}),
new Person({
id: 2
})
]),
orgs = new Organisation.List([
new Organisation({
id: 1
Expand Down Expand Up @@ -1037,12 +1037,12 @@ steal("can/model",'can/map/attributes', "can/test", "can/util/fixture", function
});
test('.model on create and update (#301)', function () {
var MyModel = can.Model.extend({
create: 'POST /todo',
update: 'PUT /todo',
model: function (data) {
return can.Model.model.call(this, data.item);
}
}, {}),
create: 'POST /todo',
update: 'PUT /todo',
model: function (data) {
return can.Model.model.call(this, data.item);
}
}, {}),
id = 0,
updateTime;
can.fixture('POST /todo', function (original, respondWith, settings) {
Expand Down Expand Up @@ -1079,8 +1079,8 @@ steal("can/model",'can/map/attributes', "can/test", "can/util/fixture", function
}, '.model works for update');
});
var instance = new MyModel({
name: 'Dishes'
}),
name: 'Dishes'
}),
saveD = instance.save();
stop();
saveD.then(function () {
Expand Down

0 comments on commit 6299c1c

Please sign in to comment.