Sha256: 8895582c6b7c81a435ea603196ce24bd2d7d8a3efc52f711b2ba0906200a9527

Contents?: true

Size: 1.36 KB

Versions: 17

Compression:

Stored size: 1.36 KB

Contents

// ==========================================================================
// SC.State Unit Test
// ==========================================================================
/*globals SC externalState1 externalState2 */

var state, params, context;

module("SC.StateRouteHandlerContext: retry Method Tests", {
  
  setup: function() { 
  
    params = { };
    
    state = SC.Object.create({

      info: {},

      handler: function(params) {
        this.info.handler = {
          params: params
        };
      }

    });
    
    context = SC.StateRouteHandlerContext.create({
      
      state: state,
      
      params: params
      
    });
    
  },
  
  teardown: function() { 
    params = state = context = null;
  }

});

test("Invoke retry with context's handler property assigned a function value", function() {

  context.set('handler', state.handler);
  context.retry();
  
  var info = state.info;
  
  ok(info.handler, "state's handler method was invoked");
  equals(info.handler.params, params, "state's handler was provided params");

});

test("Invoke retry with context's handler property assigned a string value", function() {

  context.set('handler', 'handler');
  context.retry();
  
  var info = state.info;
  
  ok(info.handler, "state's handler method was invoked");
  equals(info.handler.params, params, "state's handler was provided params");

});

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.10.2 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.10.1 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.10.0 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.9.2 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.9.1 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.9.0 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.8.2.1 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.8.1 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js
sproutcore-1.8.0 lib/frameworks/sproutcore/frameworks/statechart/tests/system/state_route_handler_context/methods/retry.js