title: Integration test a routes template in Ember.js
body: <p>I have an ember-cli 2.4.2 application that contains a route <code>myroute</code> and a template <code>myroute.hbs</code>.</p>
  
  <p>When I integration test components, I do something like this,</p>
  
  <pre><code>import { moduleForComponent, test } from 'ember-qunit';
  import hbs from 'htmlbars-inline-precompile';
  
  moduleForComponent('mycomponent', 'Integration | Component | mycomponent', {
      integration: true
  });
  
  test('the component', function(assert) {
      this.render(hbs`
          {{#mycomponent}}
              text
          {{/mycomponent}}
      `);
  
      assert.notEqual(this.$('.container').text().trim(), 'text');
  });
  </code></pre>
  
  <p>When I use <code>moduleFor('route:myroute')</code>, the call <code>this.render()</code> throws <code>this.render is not a function</code>. As below, if I call <code>route.render()</code> it throws <code>Error: Assertion Failed: Could not find "hbs{{myroute}}" template, view, or component.</code></p>
  
  <p>The goal is to integration test a route's template. I'd like to use jQuery to ensure the template rendered correctly. I have some computed properties on the route that influence what's displayed.</p>
  
  <p>I can't seem to find any good documentation on integration testing a routes template. Any ideas or pointers? Many thanks.</p>
  
  <pre><code>import Ember from 'ember';
  import { moduleFor, test } from 'ember-qunit';
  import hbs from 'htmlbars-inline-precompile';
  
  moduleFor('route:myroute', 'Integration | Route | myroute', {
      integration: true,
  });
  
  test('the route', function(assert) {
      const mockModel = {
          response: { field1: true, field2: false }
      };
  
      const route = this.subject({ model: mockModel });
  
      route.render(`hbs{{myroute}}`);
  
      // ...
  });
  </code></pre>