From a4507f095c5aec7cfbad6c99354edacf00f89452 Mon Sep 17 00:00:00 2001 From: Markus Grigull Date: Tue, 26 Jul 2016 19:26:15 +0200 Subject: [PATCH] Add simulations The simulation model replaces what simulation-model was before. A simulation is a construct of multiple simulation-models to represent the different simulator in the simulation. Added new styling guidelines and global styles for elements. --- app/controllers/simulation-model/new.js | 21 +++-- app/controllers/simulation/delete.js | 4 + app/controllers/simulation/edit.js | 4 + app/controllers/simulation/index.js | 4 + app/controllers/simulation/new.js | 38 +++++++++ app/models/project.js | 3 +- app/models/simulation-data.js | 2 +- app/models/simulation-model.js | 7 +- app/models/simulation.js | 20 +++++ app/models/user.js | 2 +- app/router.js | 10 ++- app/routes/simulation-model/new.js | 3 + app/routes/simulation-models.js | 7 -- app/routes/simulation/delete.js | 4 + app/routes/simulation/edit.js | 4 + app/routes/simulation/index.js | 17 ++++ app/routes/simulation/new.js | 14 ++++ app/routes/simulations.js | 21 +++++ app/serializers/simulation-model.js | 3 +- app/serializers/simulation.js | 18 ++++ app/styles/app.css | 82 +++++++++++++++++++ app/styles/projects.css | 27 ++++++ app/styles/simulations.css | 47 +++++++++++ app/templates/application.hbs | 2 +- app/templates/project/new.hbs | 35 ++++---- app/templates/projects.hbs | 30 +++++-- app/templates/simulation-model/new.hbs | 33 ++++++-- app/templates/simulation/delete.hbs | 1 + app/templates/simulation/edit.hbs | 1 + app/templates/simulation/index.hbs | 31 +++++++ app/templates/simulation/new.hbs | 20 +++++ app/templates/simulations.hbs | 27 ++++++ .../controllers/simulation/delete-test.js | 12 +++ .../unit/controllers/simulation/edit-test.js | 12 +++ .../unit/controllers/simulation/index-test.js | 12 +++ tests/unit/controllers/simulation/new-test.js | 12 +++ tests/unit/models/simulation-test.js | 12 +++ tests/unit/routes/simulation/delete-test.js | 11 +++ tests/unit/routes/simulation/edit-test.js | 11 +++ tests/unit/routes/simulation/index-test.js | 11 +++ tests/unit/routes/simulation/new-test.js | 11 +++ tests/unit/routes/simulations-test.js | 11 +++ tests/unit/serializers/simulation-test.js | 15 ++++ 43 files changed, 619 insertions(+), 53 deletions(-) create mode 100644 app/controllers/simulation/delete.js create mode 100644 app/controllers/simulation/edit.js create mode 100644 app/controllers/simulation/index.js create mode 100644 app/controllers/simulation/new.js create mode 100644 app/models/simulation.js create mode 100644 app/routes/simulation/delete.js create mode 100644 app/routes/simulation/edit.js create mode 100644 app/routes/simulation/index.js create mode 100644 app/routes/simulation/new.js create mode 100644 app/routes/simulations.js create mode 100644 app/serializers/simulation.js create mode 100644 app/styles/projects.css create mode 100644 app/styles/simulations.css create mode 100644 app/templates/simulation/delete.hbs create mode 100644 app/templates/simulation/edit.hbs create mode 100644 app/templates/simulation/index.hbs create mode 100644 app/templates/simulation/new.hbs create mode 100644 app/templates/simulations.hbs create mode 100644 tests/unit/controllers/simulation/delete-test.js create mode 100644 tests/unit/controllers/simulation/edit-test.js create mode 100644 tests/unit/controllers/simulation/index-test.js create mode 100644 tests/unit/controllers/simulation/new-test.js create mode 100644 tests/unit/models/simulation-test.js create mode 100644 tests/unit/routes/simulation/delete-test.js create mode 100644 tests/unit/routes/simulation/edit-test.js create mode 100644 tests/unit/routes/simulation/index-test.js create mode 100644 tests/unit/routes/simulation/new-test.js create mode 100644 tests/unit/routes/simulations-test.js create mode 100644 tests/unit/serializers/simulation-test.js diff --git a/app/controllers/simulation-model/new.js b/app/controllers/simulation-model/new.js index a5d0eba..bb24e26 100644 --- a/app/controllers/simulation-model/new.js +++ b/app/controllers/simulation-model/new.js @@ -10,30 +10,35 @@ import Ember from 'ember'; export default Ember.Controller.extend({ - sessionUser: Ember.inject.service('session-user'), + simulator: 1, actions: { newModel() { - // get current user - var user = this.get('sessionUser.user'); + // get the simulation + var simulation = this.get('model'); + var simulationId = this.get('model.id'); // create new model from properties - var properties = this.getProperties('name'); - properties['owner'] = user; + var properties = this.getProperties('name', 'simulator'); + properties['simulation'] = simulationId; var simulationModel = this.store.createRecord('simulation-model', properties); + + // this change will not be saved, but it is nessecary otherwise ember will omit the simulation's id in the post request + simulation.get('models').pushObject(simulationModel); + var controller = this; simulationModel.save().then(function() { - Ember.debug('Saved new model'); - controller.transitionToRoute('/simulation-models'); + controller.transitionToRoute('/simulation/' + simulationId); }, function() { Ember.debug('Error saving new model'); }); }, cancelNewModel() { - this.transitionToRoute('/simulation-models'); + var simulationId = this.get('model.id'); + this.transitionToRoute('/simulation/' + simulationId); } } }); diff --git a/app/controllers/simulation/delete.js b/app/controllers/simulation/delete.js new file mode 100644 index 0000000..55ff9aa --- /dev/null +++ b/app/controllers/simulation/delete.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Controller.extend({ +}); diff --git a/app/controllers/simulation/edit.js b/app/controllers/simulation/edit.js new file mode 100644 index 0000000..55ff9aa --- /dev/null +++ b/app/controllers/simulation/edit.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Controller.extend({ +}); diff --git a/app/controllers/simulation/index.js b/app/controllers/simulation/index.js new file mode 100644 index 0000000..55ff9aa --- /dev/null +++ b/app/controllers/simulation/index.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Controller.extend({ +}); diff --git a/app/controllers/simulation/new.js b/app/controllers/simulation/new.js new file mode 100644 index 0000000..bf6255d --- /dev/null +++ b/app/controllers/simulation/new.js @@ -0,0 +1,38 @@ +/** + * File: new.js + * Author: Markus Grigull + * Date: 26.07.2016 + * Copyright: 2016, Institute for Automation of Complex Power Systems, EONERC + * This file is part of VILLASweb. All Rights Reserved. Proprietary and confidential. + * Unauthorized copying of this file, via any medium is strictly prohibited. + **********************************************************************************/ + +import Ember from 'ember'; + +export default Ember.Controller.extend({ + sessionUser: Ember.inject.service('session-user'), + + actions: { + newSimulation() { + // get current user + var user = this.get('sessionUser.user'); + + // create new simulation from properties + var properties = this.getProperties('name'); + properties['owner'] = user; + + var simulation = this.store.createRecord('simulation', properties); + var controller = this; + + simulation.save().then(function() { + controller.transitionToRoute('/simulations'); + }, function() { + Ember.debug('Error saving new simulation'); + }); + }, + + cancelNewSimulation() { + this.transitionToRoute('/simulations'); + } + } +}); diff --git a/app/models/project.js b/app/models/project.js index 9c16f6d..9e1da03 100644 --- a/app/models/project.js +++ b/app/models/project.js @@ -14,5 +14,6 @@ import { hasMany, belongsTo } from 'ember-data/relationships'; export default Model.extend({ name: attr('string'), owner: belongsTo('user', { async: true }), - visualizations: hasMany('visualization', { async: true }) + visualizations: hasMany('visualization', { async: true }), + simulation: belongsTo('simulation', { async: true }) }); diff --git a/app/models/simulation-data.js b/app/models/simulation-data.js index b5cffe8..f4825db 100644 --- a/app/models/simulation-data.js +++ b/app/models/simulation-data.js @@ -25,7 +25,7 @@ export default Model.extend({ _updateHistory: function() { this._history.unshift(this.get('values')); - while (this._history.length > 500) { + while (this._history.length > 5) { this._history.shift(); } }.observes('values') diff --git a/app/models/simulation-model.js b/app/models/simulation-model.js index f970b7e..4a4b445 100644 --- a/app/models/simulation-model.js +++ b/app/models/simulation-model.js @@ -13,7 +13,8 @@ import { belongsTo, hasMany } from 'ember-data/relationships'; export default Model.extend({ name: attr('string'), - running: attr('boolean'), - owner: belongsTo('user', { async: true }), - projects: hasMany('project', { async: true }) + simulator: attr('number'), + length: attr('number'), + mapping: attr('array'), + simulation: belongsTo('simulation', { async: true }) }); diff --git a/app/models/simulation.js b/app/models/simulation.js new file mode 100644 index 0000000..e705768 --- /dev/null +++ b/app/models/simulation.js @@ -0,0 +1,20 @@ +/** + * File: simulation.js + * Author: Markus Grigull + * Date: 26.07.2016 + * Copyright: 2016, Institute for Automation of Complex Power Systems, EONERC + * This file is part of VILLASweb. All Rights Reserved. Proprietary and confidential. + * Unauthorized copying of this file, via any medium is strictly prohibited. + **********************************************************************************/ + +import Model from 'ember-data/model'; +import attr from 'ember-data/attr'; +import { belongsTo, hasMany } from 'ember-data/relationships'; + +export default Model.extend({ + name: attr('string'), + running: attr('boolean'), + owner: belongsTo('user', { async: true }), + models: hasMany('simulation-model', { aync: true }), + projects: hasMany('project', { async: true }) +}); diff --git a/app/models/user.js b/app/models/user.js index 9acf731..cded992 100644 --- a/app/models/user.js +++ b/app/models/user.js @@ -16,6 +16,6 @@ export default Model.extend({ password: attr('string'), adminLevel: attr('number'), projects: hasMany('project', { async: true }), - simulationModels: hasMany('simulation-model', { async: true }), + simulations: hasMany('simulation', { async: true }), mail: attr('string') }); diff --git a/app/router.js b/app/router.js index b0d9b40..ffdfa56 100644 --- a/app/router.js +++ b/app/router.js @@ -45,11 +45,19 @@ Router.map(function() { this.route('simulation-model', function() { this.route('index', { path: '/:modelid' }); - this.route('new'); + this.route('new', { path: '/new/:simulationid' }); this.route('delete', { path: '/delete/:modelid' }); this.route('edit', { path: '/edit/:modelid' }); }); this.route('simulation-models'); + + this.route('simulations'); + this.route('simulation', function() { + this.route('index', { path: '/:simulationid' }); + this.route('delete', { path: '/delete/:simulationid' }); + this.route('new'); + this.route('edit', { path: '/edit/:simulationid' }); + }); }); export default Router; diff --git a/app/routes/simulation-model/new.js b/app/routes/simulation-model/new.js index 79bcf5f..7ff8a7a 100644 --- a/app/routes/simulation-model/new.js +++ b/app/routes/simulation-model/new.js @@ -11,4 +11,7 @@ import Ember from 'ember'; import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; export default Ember.Route.extend(AuthenticatedRouteMixin, { + model(params) { + return this.store.findRecord('simulation', params.simulationid); + } }); diff --git a/app/routes/simulation-models.js b/app/routes/simulation-models.js index f026c22..e80ebbb 100644 --- a/app/routes/simulation-models.js +++ b/app/routes/simulation-models.js @@ -11,11 +11,4 @@ import Ember from 'ember'; import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; export default Ember.Route.extend(AuthenticatedRouteMixin, { - sessionUser: Ember.inject.service('session-user'), - - model() { - // get models for current user - var user = this.get('sessionUser.user'); - return user.get('simulationModels'); - } }); diff --git a/app/routes/simulation/delete.js b/app/routes/simulation/delete.js new file mode 100644 index 0000000..26d9f31 --- /dev/null +++ b/app/routes/simulation/delete.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/app/routes/simulation/edit.js b/app/routes/simulation/edit.js new file mode 100644 index 0000000..26d9f31 --- /dev/null +++ b/app/routes/simulation/edit.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/app/routes/simulation/index.js b/app/routes/simulation/index.js new file mode 100644 index 0000000..05b1b84 --- /dev/null +++ b/app/routes/simulation/index.js @@ -0,0 +1,17 @@ +/** + * File: index.js + * Author: Markus Grigull + * Date: 26.07.2016 + * Copyright: 2016, Institute for Automation of Complex Power Systems, EONERC + * This file is part of VILLASweb. All Rights Reserved. Proprietary and confidential. + * Unauthorized copying of this file, via any medium is strictly prohibited. + **********************************************************************************/ + +import Ember from 'ember'; +import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; + +export default Ember.Route.extend(AuthenticatedRouteMixin, { + model(params) { + return this.store.findRecord('simulation', params.simulationid); + } +}); diff --git a/app/routes/simulation/new.js b/app/routes/simulation/new.js new file mode 100644 index 0000000..8f8de75 --- /dev/null +++ b/app/routes/simulation/new.js @@ -0,0 +1,14 @@ +/** + * File: new.js + * Author: Markus Grigull + * Date: 26.07.2016 + * Copyright: 2016, Institute for Automation of Complex Power Systems, EONERC + * This file is part of VILLASweb. All Rights Reserved. Proprietary and confidential. + * Unauthorized copying of this file, via any medium is strictly prohibited. + **********************************************************************************/ + +import Ember from 'ember'; +import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; + +export default Ember.Route.extend(AuthenticatedRouteMixin, { +}); diff --git a/app/routes/simulations.js b/app/routes/simulations.js new file mode 100644 index 0000000..ce9f752 --- /dev/null +++ b/app/routes/simulations.js @@ -0,0 +1,21 @@ +/** + * File: simulations.js + * Author: Markus Grigull + * Date: 26.07.2016 + * Copyright: 2016, Institute for Automation of Complex Power Systems, EONERC + * This file is part of VILLASweb. All Rights Reserved. Proprietary and confidential. + * Unauthorized copying of this file, via any medium is strictly prohibited. + **********************************************************************************/ + +import Ember from 'ember'; +import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; + +export default Ember.Route.extend(AuthenticatedRouteMixin, { + sessionUser: Ember.inject.service('session-user'), + + model() { + // get simulations for current user + var user = this.get('sessionUser.user'); + return user.get('simulations'); + } +}); diff --git a/app/serializers/simulation-model.js b/app/serializers/simulation-model.js index ee69978..cb91820 100644 --- a/app/serializers/simulation-model.js +++ b/app/serializers/simulation-model.js @@ -11,7 +11,6 @@ import ApplicationSerializer from './application'; export default ApplicationSerializer.extend({ attrs: { - owner: { serialize: 'ids' }, - projects: { serialize: 'ids' } + simulation: { serialize: 'ids' } } }); diff --git a/app/serializers/simulation.js b/app/serializers/simulation.js new file mode 100644 index 0000000..6fe4c66 --- /dev/null +++ b/app/serializers/simulation.js @@ -0,0 +1,18 @@ +/** + * File: simulation.js + * Author: Markus Grigull + * Date: 26.07.2016 + * Copyright: 2016, Institute for Automation of Complex Power Systems, EONERC + * This file is part of VILLASweb. All Rights Reserved. Proprietary and confidential. + * Unauthorized copying of this file, via any medium is strictly prohibited. + **********************************************************************************/ + +import ApplicationSerializer from './application'; + +export default ApplicationSerializer.extend({ + attrs: { + owner: { serialize: 'ids' }, + models: { serialize: 'ids' }, + projects: { serialize: 'ids' } + } +}); diff --git a/app/styles/app.css b/app/styles/app.css index 730f10e..9aa9008 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -9,6 +9,8 @@ @import 'plots.css'; @import 'models.css'; +@import 'simulations.css'; +@import 'projects.css'; * { margin: 0; @@ -150,3 +152,83 @@ footer { background-color: #aaa; } } + +/** + * Table + */ +.column-center { + text-align: center; +} + +/** + * Table full width + */ +.table-full-width { + width: 100%; + + border: 0; + border-collapse: collapse; +} + +.table-full-width th, td { + padding: 5px; + + text-align: left; + + border: none; +} + +.table-full-width th { + background-color: #151; + color: #fff; +} + +.table-full-width tr:nth-child(even) { + background-color: #ddd; +} + +/** + * Form create record + */ +.form-create-record { + padding: 0; + + width: 400px; +} + +.form-create-record table { + border: none; +} + +.form-create-record td { + padding: 5px 10px 5px 0; +} + +.form-create-record input { + padding: 2px 4px; + + width: 100%; +} + +.form-create-record input[type=number] { + width: 60px; + + padding: 0; +} + +.form-create-record button { + background-color: #151; + color: #fff; + + font-size: 14px; + + padding: 4px 8px; + + border: none; + + cursor: pointer; +} + +.form-create-record button:hover { + background: #373; +} diff --git a/app/styles/projects.css b/app/styles/projects.css new file mode 100644 index 0000000..5bc1e13 --- /dev/null +++ b/app/styles/projects.css @@ -0,0 +1,27 @@ +/** + * File: projects.css + * Author: Markus Grigull + * Date: 26.07.2016 + * Copyright: 2016, Institute for Automation of Complex Power Systems, EONERC + * This file is part of VILLASweb. All Rights Reserved. Proprietary and confidential. + * Unauthorized copying of this file, via any medium is strictly prohibited. + **********************************************************************************/ + +/** + * Route: projects + */ +.projects-container { + margin-top: 20px; +} + +.projects-row-controls { + float: right; +} + +.projects-row-controls a { + margin-left: 10px; +} + +.projects-new-container { + margin-top: 20px; +} diff --git a/app/styles/simulations.css b/app/styles/simulations.css new file mode 100644 index 0000000..9c6a94f --- /dev/null +++ b/app/styles/simulations.css @@ -0,0 +1,47 @@ +/** + * File: simulations.css + * Author: Markus Grigull + * Date: 26.07.2016 + * Copyright: 2016, Institute for Automation of Complex Power Systems, EONERC + * This file is part of VILLASweb. All Rights Reserved. Proprietary and confidential. + * Unauthorized copying of this file, via any medium is strictly prohibited. + **********************************************************************************/ + +/** + * Route: simulations + */ +.simulations-container { + margin-top: 20px; +} + +.simulations-row-controls { + float: right; +} + +.simulations-row-controls a { + margin-left: 10px; +} + +.simulations-new-container { + margin-top: 20px; +} + +/** + * Route: simulation/index + */ + +.simulation-index-models-container { + margin-top: 20px; +} + +.simulation-index-row-controls { + float: right; +} + +.simulation-index-row-controls a { + margin-left: 10px; +} + +.simulation-index-new-model { + margin-top: 20px; +} diff --git a/app/templates/application.hbs b/app/templates/application.hbs index 0309741..ab79005 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -9,7 +9,7 @@
  • {{#link-to 'index'}}Home{{/link-to}}
  • {{#link-to 'projects'}}Projects{{/link-to}}
  • -
  • {{#link-to 'simulation-models'}}Models{{/link-to}}
  • +
  • {{#link-to 'simulations'}}Simulations{{/link-to}}
  • {{#link-to 'me'}}Account{{/link-to}}
  • {{#link-to 'logout'}}Logout{{/link-to}}
diff --git a/app/templates/project/new.hbs b/app/templates/project/new.hbs index e4989cb..a2d56d2 100644 --- a/app/templates/project/new.hbs +++ b/app/templates/project/new.hbs @@ -1,17 +1,24 @@

New project

-
-
-

- - {{input id='name' placeholder='Enter project name' value=name}} -

+ + + + + + + + + +
+ + + {{input id='name' placeholder='Enter project name' value=name}} +
+ + +
- - - - {{#if errorMessage}} -

{{errorMessage.message}}

- {{/if}} -
-
+ {{#if errorMessage}} +

{{errorMessage.message}}

+ {{/if}} + diff --git a/app/templates/projects.hbs b/app/templates/projects.hbs index 70aae57..c99113a 100644 --- a/app/templates/projects.hbs +++ b/app/templates/projects.hbs @@ -1,9 +1,27 @@

Projects

-
    - {{#each model as |project|}} -
  • {{#link-to "project.index" project.id}}{{project.name}}{{/link-to}}
  • - {{/each}} -
+
+ + + + + + {{#each model as |project|}} + + + + + {{/each}} +
Name
+ {{#link-to "project.index" project.id}}{{project.name}}{{/link-to}} + +
+ {{#link-to "project.edit" project.id}}Edit{{/link-to}} + {{#link-to "project.delete" project.id}}Delete{{/link-to}} +
+
+
-{{#link-to "project.new"}}New project{{/link-to}} +
+ {{#link-to "project.new"}}New project{{/link-to}} +
diff --git a/app/templates/simulation-model/new.hbs b/app/templates/simulation-model/new.hbs index 8056de7..7cb6197 100644 --- a/app/templates/simulation-model/new.hbs +++ b/app/templates/simulation-model/new.hbs @@ -1,11 +1,28 @@

New model

-
-

- - {{input id='name' placeholder='Enter model name' value=name}} -

- - - + + + + + + + + + + + + + +
+ + + {{input id='name' placeholder='Enter model name' value=name}} +
+ + + {{input id='simulator' value=simulator type='number' min=1 max=255 step=1}} +
+ + +
diff --git a/app/templates/simulation/delete.hbs b/app/templates/simulation/delete.hbs new file mode 100644 index 0000000..c24cd68 --- /dev/null +++ b/app/templates/simulation/delete.hbs @@ -0,0 +1 @@ +{{outlet}} diff --git a/app/templates/simulation/edit.hbs b/app/templates/simulation/edit.hbs new file mode 100644 index 0000000..c24cd68 --- /dev/null +++ b/app/templates/simulation/edit.hbs @@ -0,0 +1 @@ +{{outlet}} diff --git a/app/templates/simulation/index.hbs b/app/templates/simulation/index.hbs new file mode 100644 index 0000000..738ae2c --- /dev/null +++ b/app/templates/simulation/index.hbs @@ -0,0 +1,31 @@ +

{{model.name}}

+ +
+ + + + + + + {{#each model.models as |simulationModel|}} + + + + + + {{/each}} +
NameSimulator
+ {{#link-to "simulation-model.index" simulationModel.id}}{{simulationModel.name}}{{/link-to}} + + {{simulationModel.simulator}} + +
+ {{#link-to "simulation-model.edit" simulationModel.id}}Edit{{/link-to}} + {{#link-to "simulation-model.delete" simulationModel.id}}Delete{{/link-to}} +
+
+
+ +
+ {{#link-to "simulation-model.new" model.id}}New model{{/link-to}} +
diff --git a/app/templates/simulation/new.hbs b/app/templates/simulation/new.hbs new file mode 100644 index 0000000..211149f --- /dev/null +++ b/app/templates/simulation/new.hbs @@ -0,0 +1,20 @@ +

New simulation

+ +
+ + + + + + + + +
+ + + {{input id='name' placeholder='Enter simulation name' value=name}} +
+ + +
+
diff --git a/app/templates/simulations.hbs b/app/templates/simulations.hbs new file mode 100644 index 0000000..cac2d48 --- /dev/null +++ b/app/templates/simulations.hbs @@ -0,0 +1,27 @@ +

Simulations

+ +
+ + + + + + {{#each model as |simulation|}} + + + + + {{/each}} +
Name
+ {{#link-to "simulation.index" simulation.id}}{{simulation.name}}{{/link-to}} + +
+ {{#link-to "simulation.edit" simulation.id}}Edit{{/link-to}} + {{#link-to "simulation.delete" simulation.id}}Delete{{/link-to}} +
+
+
+ +
+ {{#link-to "simulation.new"}}New simulation{{/link-to}} +
diff --git a/tests/unit/controllers/simulation/delete-test.js b/tests/unit/controllers/simulation/delete-test.js new file mode 100644 index 0000000..97437e5 --- /dev/null +++ b/tests/unit/controllers/simulation/delete-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:simulation/delete', 'Unit | Controller | simulation/delete', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/tests/unit/controllers/simulation/edit-test.js b/tests/unit/controllers/simulation/edit-test.js new file mode 100644 index 0000000..814e36a --- /dev/null +++ b/tests/unit/controllers/simulation/edit-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:simulation/edit', 'Unit | Controller | simulation/edit', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/tests/unit/controllers/simulation/index-test.js b/tests/unit/controllers/simulation/index-test.js new file mode 100644 index 0000000..c060398 --- /dev/null +++ b/tests/unit/controllers/simulation/index-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:simulation/index', 'Unit | Controller | simulation/index', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/tests/unit/controllers/simulation/new-test.js b/tests/unit/controllers/simulation/new-test.js new file mode 100644 index 0000000..1f75ab8 --- /dev/null +++ b/tests/unit/controllers/simulation/new-test.js @@ -0,0 +1,12 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:simulation/new', 'Unit | Controller | simulation/new', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +// Replace this with your real tests. +test('it exists', function(assert) { + let controller = this.subject(); + assert.ok(controller); +}); diff --git a/tests/unit/models/simulation-test.js b/tests/unit/models/simulation-test.js new file mode 100644 index 0000000..fa6a585 --- /dev/null +++ b/tests/unit/models/simulation-test.js @@ -0,0 +1,12 @@ +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('simulation', 'Unit | Model | simulation', { + // Specify the other units that are required for this test. + needs: [] +}); + +test('it exists', function(assert) { + let model = this.subject(); + // let store = this.store(); + assert.ok(!!model); +}); diff --git a/tests/unit/routes/simulation/delete-test.js b/tests/unit/routes/simulation/delete-test.js new file mode 100644 index 0000000..582dca0 --- /dev/null +++ b/tests/unit/routes/simulation/delete-test.js @@ -0,0 +1,11 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:simulation/delete', 'Unit | Route | simulation/delete', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); diff --git a/tests/unit/routes/simulation/edit-test.js b/tests/unit/routes/simulation/edit-test.js new file mode 100644 index 0000000..9cb2ae5 --- /dev/null +++ b/tests/unit/routes/simulation/edit-test.js @@ -0,0 +1,11 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:simulation/edit', 'Unit | Route | simulation/edit', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); diff --git a/tests/unit/routes/simulation/index-test.js b/tests/unit/routes/simulation/index-test.js new file mode 100644 index 0000000..ba31a78 --- /dev/null +++ b/tests/unit/routes/simulation/index-test.js @@ -0,0 +1,11 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:simulation/index', 'Unit | Route | simulation/index', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); diff --git a/tests/unit/routes/simulation/new-test.js b/tests/unit/routes/simulation/new-test.js new file mode 100644 index 0000000..340a6bd --- /dev/null +++ b/tests/unit/routes/simulation/new-test.js @@ -0,0 +1,11 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:simulation/new', 'Unit | Route | simulation/new', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); diff --git a/tests/unit/routes/simulations-test.js b/tests/unit/routes/simulations-test.js new file mode 100644 index 0000000..b72a094 --- /dev/null +++ b/tests/unit/routes/simulations-test.js @@ -0,0 +1,11 @@ +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:simulations', 'Unit | Route | simulations', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); diff --git a/tests/unit/serializers/simulation-test.js b/tests/unit/serializers/simulation-test.js new file mode 100644 index 0000000..40a61cd --- /dev/null +++ b/tests/unit/serializers/simulation-test.js @@ -0,0 +1,15 @@ +import { moduleForModel, test } from 'ember-qunit'; + +moduleForModel('simulation', 'Unit | Serializer | simulation', { + // Specify the other units that are required for this test. + needs: ['serializer:simulation'] +}); + +// Replace this with your real tests. +test('it serializes records', function(assert) { + let record = this.subject(); + + let serializedRecord = record.serialize(); + + assert.ok(serializedRecord); +});