Commit Graph

91 Commits

Author SHA1 Message Date
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
ee062f6de6 Fix assertion count. 2012-06-06 14:46:32 -04:00
brad dunbar
d7e77b1af8 Merge pull request #1327 from TheBits/silent-merge
Merge model with silent flag
2012-06-06 04:36:10 -07:00
Brad Dunbar
7828d6d22d Prefer on/off over bind/unbind. 2012-06-03 15:06:44 -04: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
brad dunbar
b6dc6a224e Merge pull request #1342 from caseywebdev/master
Allow Collection to receive falsy `comparator` to override default
2012-05-24 09:26:40 -07:00
Casey Foster
c016a1c58f Added a few more cases for the test 2012-05-24 09:11:29 -07:00
Casey Foster
4a0acdee50 Simplified falsy comparator test case 2012-05-24 09:02:22 -07:00
Sam Breed
98e01bbc4a adding test for falsy comparators (#1342) 2012-05-23 23:53:13 -06:00
Jeremy Ashkenas
f86674d6a7 Fixes #1343, adding Collection#slice 2012-05-23 17:13:48 -04:00
Sergey Mezentsev
3630b04ed0 Improve test "merge in duplicate models with {merge: true}" 2012-05-17 19:21:04 +04:00
Jeremy Ashkenas
c7a7584fca Merge pull request #1275 from braddunbar/qunit-1.5.0
Update QUnit.
2012-05-03 07:33:12 -07: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
46d43ae5bf null and undefined are invalid ids. 2012-05-02 17:34:59 -04:00
Jeremy Ashkenas
07a00ba45d adding tests for merge:true 2012-04-23 17:15:58 -04:00
Brad Dunbar
35bb2c0fdc Use raises correctly. 2012-04-18 11:03:40 -04:00
Raúl Naveiras
db4b617697 add ignores comparator when at option is passed 2012-03-26 16:30:26 +02:00
Jeremy Ashkenas
7b6dbc8dcd Merge pull request #1021 from ahamid/reset_passes_options
small patch to allow passing options through reset to model initializer
2012-03-19 14:00:58 -07:00
Jeremy Ashkenas
de599c169d Fixes #991. Add Collection#where for simple filters 2012-03-19 16:34:53 -04:00
Brad Dunbar
9ffc84c9fe Fix #1112 - options.model sets collection.model. 2012-03-18 22:28:08 -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
Aaron Hamid
79045c11cb small patch to allow passing options through reset to model initializer 2012-02-17 04:03:30 -05:00
Jeremy Ashkenas
18fba57724 Much asked-for change. Instead of throwing an early error when adding duplicate models, Backbone will simply skip them instead. 2012-02-13 14:39:36 -05:00
Jeremy Ashkenas
2a92f71dcc Merge branch 'master' of github.com:documentcloud/backbone 2012-02-08 16:59:11 -05:00
Jeremy Ashkenas
e3ac6f8eaa Adding Collection#push, pop, shift, and unshift to the API, returning references to the model. Fixing a too-unescaped regex. 2012-02-08 16:58:37 -05:00
Brad Dunbar
522e090831 fixes #964 - collection.get has consistent return 2012-02-06 16:45:06 -05:00
Brad Dunbar
954da679ed Refactor some tests.
* Use object for lastRequest to prevent errors.
* Ensure setDOMLibrary tests are cleaned up.
2012-02-02 19:36:50 -05:00
Jeremy Ashkenas
a865aa41f1 removing obsolete error case. 2012-02-02 17:15:28 -05:00
Jeremy Ashkenas
aafbcb05e5 Fixes #917 -- reverts validate() behavior to never run on silent sets. 2012-02-02 15:40:06 -05:00
Brad Dunbar
ec61503c87 fixes #928 - Save sends correct attrs.
* Temporarily set model's attrs for `sync`.
* Remove cross-module (global) dependencies in
  Collection, Model, and sync test modules.
2012-02-02 08:57:47 -05:00
Brad Dunbar
50e8103fdf check for duplicate models/ids 2012-01-30 15:24:41 -05:00
Jeremy Ashkenas
ab164c450d Overhauling 'validate' -- Receives the computed new state of the attrs, not just the delta. Now runs on model create, raising an exception if you try to 'new' and invalid model ... also runs even if changed silently. 2012-01-23 18:16:20 -05:00
Jeremy Ashkenas
910ca3c190 Merge pull request #866 from braddunbar/add-tweaks
Collection#add tweaks
2012-01-17 22:50:17 -08:00
Brad Dunbar
09ab8cb17d Collection#add tweaks
* leave collection in a consistent state after throw
* correct indices
2012-01-17 23:53:02 -05:00
Brad Dunbar
397d11e340 equals is deprecated; use equal instead
http://docs.jquery.com/QUnit/equal#actualexpectedmessage
2012-01-17 23:52:12 -05:00
Jeremy Ashkenas
cea56e523a Fixes #563. Initial draft of 'wait: true' for pessimistic instead of optimistic save() create() and destroy(). Makes it easier to have your asynchronous UI and eat it too. 2012-01-17 15:26:26 -05:00
Jeremy Ashkenas
09110a6656 removing erroneous console.log 2012-01-17 11:18:17 -05:00
Jeremy Ashkenas
2d02a3cfb6 Fixes #861, better error message for adding invalid models to a collection. 2012-01-17 10:54:03 -05:00
Jeremy Ashkenas
7ba0275613 Fixes #574, clone 'models' before removing, so as to allow collection.remove(collection.models) 2012-01-17 10:29:01 -05:00
Jeremy Ashkenas
2dce413247 Adding options.index to Collection#add and #remove. 2012-01-13 17:20:15 -05:00
Jeremy Ashkenas
a8bd142b64 Fixes #714, assign model.collection early, so that those overriding set() can use it from the get-go. 2012-01-13 13:19:28 -05:00
Jeremy Ashkenas
a49bb4f3e1 Fixes #811 -- allow you to pass a context when unbinding events as well. 2012-01-12 17:09:15 -05:00
Jeremy Ashkenas
1d90bb9cfc binding the comparator function before using it, so that you can rely on properties of your collection within it. 2012-01-12 15:13:22 -05:00
Jeremy Ashkenas
8cfb243b8e Fixes #836, Fixes #708 -- going back to previous stance: two models with the same id can't be added to the same collection. 2012-01-11 17:03:30 -05:00
Jeremy Ashkenas
bf1ffbeb67 nice refactor. removed _add and _remove and moved 'em in to the public API. 2012-01-11 13:45:16 -05:00
Brad Dunbar
c8919c4b05 collection.add should not alter models array 2012-01-10 17:18:11 -05:00
Jeremy Ashkenas
1715c181ad Fixes #81 -- optimize for addition of large arrays of models, not for individual inserts. 2012-01-06 15:42:43 -05:00
Jeremy Ashkenas
6b3ff7b035 Fixes #9, Backbone comparators can now be either sort() or sortBy() iterators. 2012-01-06 14:53:43 -05:00