Sha256: c177fbf7bddeac34abb8b81a1f8e982680bd60dcca947fc4e1a19de76b2ca7dd

Contents?: true

Size: 1.51 KB

Versions: 39

Compression:

Stored size: 1.51 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Apple Inc. and contributors.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

(function() {
  var store, Person, Place;

  module("SC.Store#unloadRecord", {
    setup: function() {
      Person = SC.Record.extend({
        name: SC.Record.attr(String)
      });

      Place = SC.Record.extend({
        name: SC.Record.attr(String)
      });

      SC.RunLoop.begin();

      store = SC.Store.create();

      store.loadRecords(Person, [
        {guid: 1, name: 'Soups'},
        {guid: 2, name: 'Palmdale'},
        {guid: 3, name: 'Dubs'}
      ]);

      store.loadRecords(Place, [
        {guid: 4, name: "San Francisco"},
        {guid: 5, name: "St. John's"}
      ]);

      SC.RunLoop.end();
    },
    teardown: function() {
      store = Person = Place = null;
    }
  });

  test("Unload one record via storeKey", function() {
    var people = store.find(Person),
        record = store.find(Person, 1);

    equals(people.get('length'), 3, "precond - there are 3 People records in the store");

    store.unloadRecord(Person, 1);

    people = store.find(Person);
    equals(people.get('length'), 2, "there are 2 People records in the store after calling unloadRecord");
    ok(store.peekStatus(record) & SC.Record.EMPTY, "Record now has status of SC.Record.EMPTY");
  });

})();

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.7.1.beta-java lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.7.1.beta lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/unloadRecord.js