title: How to resolve needs dependency when testing ember app
body: <p>I am trying to test a controller and for simplicity lets name it 'A'. In the template for my "A" controller, I render another controller "B" like: </p>
  
  <pre><code>&lt;div&gt; blah blah &lt;/div&gt;
  {{render 'B'}}
  </code></pre>
  
  <p>my "B" Controller in turn needs "C". Given this long chain, I was trying to write a unit test for "A" controller and running into dependency error like:</p>
  
  <p><strong>Error: Assertion Failed: &lt; AS.B:ember571 > needs controller:c but it does not exist</strong></p>
  
  <p>I feel like I need to do something in my beforeEach method. Currently it looks something like :</p>
  
  <pre><code>beforeEach(function () {
          container = AS.__container__;
          store = container.lookup('store:main');
  
          Ember.run(function () {
              store.find('A').then(function (data) {
  
                  //WHAT CAN I DO HERE TO SET CORRECT DEPENDENCY!!
                  //container.register('controller:c', {});
                  //container.register('controller:b', AS.BController.create({container: container}));
  
                  controller = AS.__container__.lookup('controller:a');
                  controller.set('content', data);
  
  
                  view = AS.AView.create({
                      container: container,
                      controller: controller,
                      context: controller
                  });
  
                  view.append();
              });
          });
      });
  </code></pre>
  
  <p>Thanks,
  Dee</p>