150 Commits

Author SHA1 Message Date
Phil Freo
dc0bfe40d8 failing unit tests with 'defaults' 2012-12-13 14:54:44 -05:00
Jeremy Ashkenas
50be4423f1 Fixes #1913 -- updates Backbone defaults semantics to use _.defaults. 2012-12-13 13:23:13 -05:00
Tim Griesser
cc164563d6 fixing issue in patch not sending data 2012-12-12 19:42:21 -05:00
Jeremy Ashkenas
69b3c1382d optimize computeChanges() by removing a splice, and fix a bug with multiple falsy values being set for an attribute 2012-12-12 16:48:33 -05:00
Jeremy Ashkenas
6ea96c167d unset does *not* need to fire a change for undefined attributes 2012-12-12 16:29:29 -05:00
Jeremy Ashkenas
02a78ac9ae adding a test to ensure that changes are triggered in the appropriate order. 2012-12-12 16:24:22 -05:00
Jeremy Ashkenas
36c3e44e19 you shouldn't be able to set(model), instead set(model.attributes) 2012-12-12 16:02:40 -05:00
Jeremy Ashkenas
d4d2daf891 Fixes #618 -- support for a simple version of PATCH 2012-12-10 16:31:02 -05:00
Jeremy Ashkenas
23cc302a51 Fixes #1477 -- Changing Backbone's internal logic so that validation always happens, even when silent: true. Defining a validate should never allow state to become invalid, even during a silent change. 2012-12-06 16:48:29 -05:00
Jeremy Ashkenas
29dc8fc2bc initial merge of tgriesser's change cleanup 2012-11-28 17:04:27 -05:00
Jeremy Ashkenas
ef8bb66839 Asserting that cloning a model and passing it in as attributes doesn't share object identity. 2012-11-19 17:00:47 -05:00
Casey Foster
7909341139 Add test for #1791 2012-11-01 17:09:05 -07:00
Sam Breed
46b8ee3358 testing expected behavior when Model.parse returns null 2012-10-14 17:32:17 -06:00
Tim Griesser
36516d9a3e Overhauling set/change for speed improvements 2012-10-05 19:41:40 -04:00
Jeremy Ashkenas
bdefd3cce1 Merge branch 'change-bug' of https://github.com/tgriesser/backbone 2012-10-03 15:11:01 -04:00
Jeremy Ashkenas
06c764c5e8 merge conflict resolved 2012-10-01 17:06:27 -04:00
Tim Griesser
71b6404d73 refactor change/set, fixing #1478 and #1664 2012-10-01 15:16:55 -04:00
Sam Breed
b347f9f8d4 consistently handle undefined being passed to the model constr (#1545) 2012-10-01 10:06:00 -06:00
Brad Dunbar
33cdab412e Drop doubled test prefixes. 2012-09-05 08:52:27 -04:00
Brad Dunbar
8ef1730b73 Consolidate test boilerplate; use consistent names. 2012-08-31 11:39:34 -04:00
Brad Dunbar
1f3f45252f Consolidate sync/error events in Backbone.sync. 2012-08-29 16:14:48 -04:00
Brad Dunbar
005173434e Fix #1377 - Saving without attrs triggers "error". 2012-07-17 18:35:25 -04:00
Chris Baynes
3a388b69cf Always trigger error when validation fails. 2012-07-05 16:39:31 +02:00
Chris Baynes
306e20ecab Trigger error even when providing a callback. 2012-07-05 15:45:01 +02:00
Brad Dunbar
ff561ca206 Fix #1447 - model.save does not delete options.wait. 2012-06-25 07:39:48 -04:00
Brad Dunbar
af5e8f5c72 Fix #1433 - Do not save invalid models. 2012-06-22 08:02:00 -04:00
Brad Dunbar
b6b9ec72ff Fix #1365 - Destroy: new models execute success callback. 2012-06-16 11:33:05 -04:00
Brad Dunbar
4286e0c5ec Fix #1403 - Trigger "sync" unconditionally. 2012-06-16 10:45:01 -04:00
Brad Dunbar
4ecc161ecf Tweak tests a bit. 2012-06-15 11:30:49 -04:00
Casey Foster
f24ca5a0ed #1412 - Trigger "sync" event for fetch also 2012-06-15 07:33:38 -07:00
Brad Dunbar
39551232d7 Quote attributes correctly for older browsers. 2012-06-14 14:47:57 -04:00
Brad Dunbar
f133f0d5dc Ensure tests run in IE7. 2012-06-12 11:31:34 -04:00
Brad Dunbar
41f64c7f1a Refactor a test for simplicity. 2012-06-03 13:55:40 -04:00
Sam Breed
626e3f16f7 adding correct number of expected assertions to nested change events model test 2012-06-03 11:38:18 -06:00
Sam Breed
f4ebee0406 adding the expected argument to all tests 2012-06-02 18:07:11 -06:00
Sam Breed
c924e05bff adding tests for #1355 2012-05-30 11:32:53 -04:00
Sam Breed
cacd01d530 Fix #1292 - unexpected results when passing undefined to Model.hasChanged()
* additional check in hashChanged for when `attr` is present but undefined
* adds tests for expected results when passing undefined
2012-05-07 19:45:03 -06:00
Brad Dunbar
70005fdd04 Update QUnit.
* Use `deepEqual` in place of `same`.
* Expect 0 tests where appropriate.
* Update view test to use #qunit-fixture.
* Remove `QUnit.config.reorder = false;`.
2012-05-02 20:54:27 -04:00
Brad Dunbar
64205fbd1f Add tests for #1122. 2012-04-24 11:33:15 -04:00
Jeremy Ashkenas
bf9e4f6335 adding a test for the previous commit -- failed save with wait:true 2012-04-23 17:58:10 -04:00
Brad Dunbar
87c9b17aa7 Fix #474 - Backbone.ajax 2012-04-11 08:33:20 -04:00
Brad Dunbar
137b7fd670 Fix #1179 - isValid returns true in the absence of validate. 2012-04-04 05:28:40 -07:00
Jeremy Ashkenas
f4a1ebc374 fixes #1030 -- save with wait:true with a synchronous Backbone.sync 2012-03-21 11:18:30 -04:00
Jeremy Ashkenas
e9e1abfe61 model.destroy() returns false if the model.isNew() 2012-03-21 10:40:54 -04:00
Brad Dunbar
6948b59e61 Fix #1057 - Save with wait validates model. 2012-03-18 08:59:23 -04:00
Jeremy Ashkenas
64f37ce00e fixes #1067, urlRoot vs collection.url() order 2012-03-12 11:22:44 -04:00
Aidan Feldman
f49969014c clean up tests to use fresh object instances for each run, and don't set
globals within test files
2012-03-12 04:27:22 -04:00
Jeremy Ashkenas
83d2918bc7 removing a test that is invalid in IE. 2012-02-27 14:32:30 -05:00
Brad Dunbar
69b80f5e3a Fixes #959 - Silent changes fire 'change:attr'.
* Silent changes are tracked so `'change:attr'` can be
  fired next time `change` is called.
* Pending changes are tracked to prevent infinite loops
  and accurately reflect nested changes.
2012-02-17 07:22:43 -05:00
Brad Dunbar
1d921d690a Add tests for #906. 2012-02-02 20:26:41 -05:00