Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
DataManager:SessionLocal - Add test to check that session stored data…
Browse files Browse the repository at this point in the history
… is loaded if a store is created matching that data
  • Loading branch information
kborchers committed Jan 4, 2013
1 parent 61d3b49 commit 21b2dc9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/unit/data-manager/data-manager-sessionLocal.js
Expand Up @@ -128,7 +128,8 @@ test( "add and remove - object ", function() {
module( "DataManager: SessionLocal - Data Manipulation" );

// Create a session based dataManager to store data for some tests
var userStore = AeroGear.DataManager({
var userStoreReload,
userStore = AeroGear.DataManager({
name: "users",
type: "SessionLocal"
}).stores.users;
Expand Down Expand Up @@ -177,6 +178,18 @@ test( "save - initialize", function() {
]);

equal( userStore.read().length, 6, "Initial data added to store" );

userStoreReload = AeroGear.DataManager({
name: "users",
type: "SessionLocal"
}).stores.users;
});

// Check data was loaded from existing session store
test( "load session stored data", function() {
expect( 1 );

equal( userStoreReload.read().length, 6, "Previously stored data added to store" );
});

// Read data
Expand Down

0 comments on commit 21b2dc9

Please sign in to comment.