February 2016
Beginner to intermediate
308 pages
5h 46m
English
Testing routes can be done either by acceptance tests or unit tests. In this example, we'll create a simple unit test for a route.
students route:
$ ember g route students
This command will generate the route code for students.
// app/routes/students.js
import Ember from 'ember';
export default Ember.Route.extend({
someText: 'someText'
});This route has a property called someText.
students-tests.js file in the tests/unit/routes folder:// tests/unit/routes/students-test.js import { moduleFor, test } from 'ember-qunit'; moduleFor('route:students', 'Unit | Route | students', { // Specify the other units that are required ...Read now
Unlock full access