Sha256: e9bf8fea9e9189cb8b1b04e98d5a8f6552a9ffc9616324f75b268c31ef6942e6

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

import { moduleFor, ApplicationTestCase } from 'internal-test-helpers';
import { run } from '@ember/runloop';
import { Router } from '@ember/-internals/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

1 entries across 1 versions & 1 rubygems

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