Sha256: 90f30ac5c01844e293c0a6ec34fc2a7c0b26f66de055dd1f09985365a7ee579d

Contents?: true

Size: 1.5 KB

Versions: 17

Compression:

Stored size: 1.5 KB

Contents

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

var store, storeKey1,storeKey2;
var json1, json2;
var storeKey6, storeKey7;

module("SC.Store#cancelRecord", {
  setup: function() {
    
    store = SC.Store.create();
    
    json1 = {
      guid: "cancelGUID1",
      string: "string",
      number: 23,
      bool:   YES
    };
    json2 = {
      guid: "cancelGUID2",
      string: "string",
      number: 23,
      bool:   YES
    };
    
    storeKey1 = SC.Store.generateStoreKey();
    store.writeDataHash(storeKey1, json1, SC.Record.EMPTY);
    storeKey2 = SC.Store.generateStoreKey();
    store.writeDataHash(storeKey2, json2, SC.Record.READY_NEW);
    }
});

test("Check for error state handling and make sure that the method executes.", function() {
  var throwError=false;
  try{
    store.cancelRecord(undefined, undefined, storeKey1);
    throwError=false;
  }catch (error){
    throwError=true;
  }
  ok(throwError, "cancelRecord should throw and error if the record status is EMPTY or ERROR");
  try{
    store.cancelRecord(undefined, undefined, storeKey2);
    throwError=true;    
  }catch (error){
    throwError=false;
  }
  ok(throwError, " cancelRecord was succesfully executed.");
  
});

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
sproutit-sproutcore-1.0.20090721145285 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1046 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1043 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1042 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1037 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1035 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1031 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1030 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1029 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1027 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1028 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1026 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1025 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1024 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1009 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1008 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js
sproutcore-1.0.1003 frameworks/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js