Skip to content

Instantly share code, notes, and snippets.

@sly7-7
Created September 17, 2014 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sly7-7/ec7a5db29299c3a4fdcf to your computer and use it in GitHub Desktop.
Save sly7-7/ec7a5db29299c3a4fdcf to your computer and use it in GitHub Desktop.
function loadScenarioViewController(project, model, actionDefinition) {
var controller, store = App.TestHelper.lookupStore(),
router = App.__container__.lookup('router:main'),
commander = App.Commander.create({store: store}),
App.__container__.register("controller:project", Ember.ObjectController.extend({content: project}));
controller = App.ScenarioController.create({
container: App.__container__,
target: router,
content: model,
project: project,
commander: commander
});
view = Ember.View.create({
container: App.__container__,
controller: controller,
context: controller,
templateName: 'scenario/scenario'
});
view.appendTo('#ember-testing');
server.setElementSerializationServerStubs("1", 'scenario', '1', {
_definition: scenarioDef.toString(),
_definitionJson: scenarioDef
});
server.respond();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment