Sha256: e82169cae058d0327a1b8824034ee6fe2cbc2bbf443956a459728a66537e6441

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

import { moduleFor, ApplicationTestCase } from 'internal-test-helpers';
import { run } from '@ember/runloop';
import { Router } from 'ember-routing';

moduleFor(
  'Router.map',
  class extends ApplicationTestCase {
    ['@test Router.map returns an Ember Router class'](assert) {
      assert.expect(1);

      let ret = this.router.map(function() {
        this.route('hello');
      });

      assert.ok(Router.detect(ret));
    }

    ['@test Router.map can be called multiple times'](assert) {
      assert.expect(2);

      this.addTemplate('hello', 'Hello!');
      this.addTemplate('goodbye', 'Goodbye!');

      this.router.map(function() {
        this.route('hello');
      });

      this.router.map(function() {
        this.route('goodbye');
      });

      return run(() => {
        return this.visit('/hello')
          .then(() => {
            this.assertText('Hello!');
          })
          .then(() => {
            return this.visit('/goodbye');
          })
          .then(() => {
            this.assertText('Goodbye!');
          });
      });
    }
  }
);

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
discourse-ember-source-3.5.1.1 dist/es/ember/tests/routing/router_map_test.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember/tests/routing/router_map_test.js