Sha256: 513d0bbd270ad983242b7694689a436079691e15276c1c7cc298ef22ce6f82a8

Contents?: true

Size: 1.3 KB

Versions: 14

Compression:

Stored size: 1.3 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            ©2008-2011 Apple Inc. All rights reserved.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================
// ========================================================================
// SC.UserDefaults Base Tests
// ========================================================================
/*globals module test ok isObj equals expects */

var obj; //global variables

module("User Defaults",{
 	   
 	  setup: function(){
 	   
 	   obj = SC.Object.create({
 		   bck : 'green'
 	    }); 	

 	  SC.userDefaults.defaults({
			'app:testingValue': 99
		});
 	}
});



test("To check if the user defaults are stored and read from local storage",function(){
    SC.userDefaults.writeDefault('Back',obj.bck);
    equals(SC.userDefaults.readDefault('Back'), obj.bck, 'should read written property');
});

test("Test readDefault function will return a predefined default value when loading in Firefox v13", function() {

  var expected = 99;
  var result   = SC.userDefaults.readDefault('testingValue');
  equals(result, expected, "test should equal 99");
});

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js