Sha256: 47ddc672a55cc8b8150b0c6ace0648369e4231cf7c4b88a373354a33b74dfdb7

Contents?: true

Size: 1.41 KB

Versions: 22

Compression:

Stored size: 1.41 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Apple Inc. and contributors.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================
/*globals module ok equals same test MyApp */

var store, Application;
module("SC.RecordArray Error Methods", {
  setup: function() {

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

    SC.RunLoop.begin();
    store = SC.Store.create();

    var records = [
      { guid: 1, name: 'Thing One' },
      { guid: 2, name: 'Thing Two' }
    ];

    var types = [ Application.Thing, Application.Thing ];

    store.loadRecords(types, records);
    SC.RunLoop.end();
  },

  teardown: function() {
    store = null;
    Application = null;
  }
});

test("Verify error methods behave correctly", function() {
  var q = SC.Query.local(Application.Thing);
  var things = store.find(q);

  SC.RunLoop.begin();
  things.set('status', SC.Record.BUSY_LOADING);
  store.dataSourceDidErrorQuery(q, SC.Record.GENERIC_ERROR);
  SC.RunLoop.end();

  ok(things.get('isError'), "isError on things array should be YES");

  equals(things.get('errorObject'), SC.Record.GENERIC_ERROR,
    "get('errorObject') on things array should return the correct error object");
});

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
sproutcore-1.6.0.1-java lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.1 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0-java lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.rc.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.rc.2 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.rc.2-java lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.rc.1-x86-mingw32 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.rc.1 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.rc.1-java lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.beta.3-x86-mingw32 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.beta.3-java lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.beta.3 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.beta.2-x86-mingw32 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.beta.2-java lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.beta.2 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.6.0.beta.1 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.5.0-java lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js
sproutcore-1.5.0 lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js