mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
Add user and project data from backend
This commit is contained in:
parent
0d68adcde2
commit
9f8a165c69
45 changed files with 548 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -15,3 +15,5 @@
|
|||
/libpeerconnection.log
|
||||
npm-debug.log
|
||||
testem.log
|
||||
|
||||
.DS_Store
|
||||
|
|
8
app/adapters/application.js
Normal file
8
app/adapters/application.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import JSONAPIAdapter from 'ember-data/adapters/json-api';
|
||||
import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin';
|
||||
|
||||
export default JSONAPIAdapter.extend(DataAdapterMixin, {
|
||||
host: 'http://192.168.99.100:3000',
|
||||
namespace: 'api/v1',
|
||||
authorizer: 'authorizer:custom'
|
||||
});
|
47
app/authenticators/custom.js
Normal file
47
app/authenticators/custom.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
import Ember from 'ember';
|
||||
import Base from 'ember-simple-auth/authenticators/base';
|
||||
|
||||
export default Base.extend({
|
||||
tokenEndpoint: 'http://192.168.99.100:3000/api/v1/authenticate',
|
||||
|
||||
restore(data) {
|
||||
return new Ember.RSVP.Promise(function(resolve, reject) {
|
||||
if (!Ember.isEmpty(data.token)) {
|
||||
resolve(data);
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
authenticate(username, password) {
|
||||
return new Ember.RSVP.Promise((resolve, reject) => {
|
||||
Ember.$.ajax({
|
||||
url: this.tokenEndpoint,
|
||||
type: 'POST',
|
||||
data: JSON.stringify({
|
||||
username: username,
|
||||
password: password
|
||||
}),
|
||||
contentType: 'application/json',
|
||||
dataType: 'json'
|
||||
}).then(function(response) {
|
||||
Ember.run(function() {
|
||||
resolve({
|
||||
token: response.token
|
||||
});
|
||||
});
|
||||
}, function(xhr) {
|
||||
var response = xhr.responseText;
|
||||
Ember.run(function() {
|
||||
reject(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
invalidate() {
|
||||
console.log('invalidate...');
|
||||
return Ember.RSVP.resolve();
|
||||
}
|
||||
});
|
12
app/authorizers/custom.js
Normal file
12
app/authorizers/custom.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import Ember from 'ember';
|
||||
import Base from 'ember-simple-auth/authorizers/base';
|
||||
|
||||
export default Base.extend({
|
||||
session: Ember.inject.service('session'),
|
||||
|
||||
authorize(data, block) {
|
||||
if (this.get('session.isAuthenticated') && !Ember.isEmpty(data.token)) {
|
||||
block('x-access-token', data.token);
|
||||
}
|
||||
}
|
||||
});
|
5
app/controllers/application.js
Normal file
5
app/controllers/application.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
session: Ember.inject.service('session')
|
||||
});
|
14
app/controllers/login.js
Normal file
14
app/controllers/login.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
session: Ember.inject.service('session'),
|
||||
|
||||
actions: {
|
||||
authenticate() {
|
||||
let { username, password } = this.getProperties('username', 'password');
|
||||
this.get('session').authenticate('authenticator:custom', username, password).catch((reason) => {
|
||||
this.set('errorMessage', reason);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
11
app/controllers/project/new.js
Normal file
11
app/controllers/project/new.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
actions: {
|
||||
newProject() {
|
||||
// create project from form values
|
||||
let properties = this.getProperties('name');
|
||||
var project = this.store.createRecord('project', properties);
|
||||
}
|
||||
}
|
||||
});
|
8
app/models/project.js
Normal file
8
app/models/project.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import Model from 'ember-data/model';
|
||||
import attr from 'ember-data/attr';
|
||||
import belongsTo from 'ember-data/relationships';
|
||||
|
||||
export default Model.extend({
|
||||
name: attr('string')/*,
|
||||
owner: belongsTo('user')*/
|
||||
});
|
10
app/models/user.js
Normal file
10
app/models/user.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import Model from 'ember-data/model';
|
||||
import attr from 'ember-data/attr';
|
||||
import hasMany from 'ember-data/relationships';
|
||||
|
||||
export default Model.extend({
|
||||
username: attr('string'),
|
||||
password: attr('string'),
|
||||
adminLevel: attr('number')/*,
|
||||
projects: hasMany('project')*/
|
||||
});
|
|
@ -6,6 +6,15 @@ const Router = Ember.Router.extend({
|
|||
});
|
||||
|
||||
Router.map(function() {
|
||||
this.route('login');
|
||||
|
||||
this.route('projects');
|
||||
this.route('project', function() {
|
||||
this.route('index', { path: '/:projectid' });
|
||||
this.route('new');
|
||||
this.route('edit', { path: '/edit/:projectid' });
|
||||
this.route('delete', { path: '/delete/:projectid' });
|
||||
});
|
||||
});
|
||||
|
||||
export default Router;
|
||||
|
|
10
app/routes/application.js
Normal file
10
app/routes/application.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import Ember from 'ember';
|
||||
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
|
||||
|
||||
export default Ember.Route.extend(ApplicationRouteMixin, {
|
||||
actions: {
|
||||
invalidateSession() {
|
||||
this.get('session').invalidate();
|
||||
}
|
||||
}
|
||||
});
|
5
app/routes/index.js
Normal file
5
app/routes/index.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import Ember from 'ember';
|
||||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||
|
||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||
});
|
4
app/routes/login.js
Normal file
4
app/routes/login.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
});
|
4
app/routes/project/delete.js
Normal file
4
app/routes/project/delete.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
});
|
4
app/routes/project/edit.js
Normal file
4
app/routes/project/edit.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
});
|
8
app/routes/project/index.js
Normal file
8
app/routes/project/index.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
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('project', params.projectid);
|
||||
}
|
||||
});
|
4
app/routes/project/new.js
Normal file
4
app/routes/project/new.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
});
|
8
app/routes/projects.js
Normal file
8
app/routes/projects.js
Normal file
|
@ -0,0 +1,8 @@
|
|||
import Ember from 'ember';
|
||||
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
|
||||
|
||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||
model() {
|
||||
return this.store.findAll('project');
|
||||
}
|
||||
});
|
5
app/serializers/application.js
Normal file
5
app/serializers/application.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
import JSONSerializer from 'ember-data/serializers/json';
|
||||
|
||||
export default JSONSerializer.extend({
|
||||
primaryKey: '_id'
|
||||
});
|
|
@ -0,0 +1,106 @@
|
|||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Application skeleton
|
||||
*/
|
||||
.ember-application {
|
||||
min-width: 800px;
|
||||
|
||||
background: #ddd;
|
||||
color: #4d4d4d;
|
||||
|
||||
font: 16px 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
font-weight: 300;
|
||||
font-smoothing: antialiased;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
header {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
|
||||
padding: 10px 0 0 0;
|
||||
|
||||
color: #fff;
|
||||
background-color: #151;
|
||||
}
|
||||
|
||||
header h1 {
|
||||
width: 100%;
|
||||
|
||||
text-align: center
|
||||
}
|
||||
|
||||
footer {
|
||||
width: 100%;
|
||||
|
||||
color: #666;
|
||||
|
||||
margin-top: 20px;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/**
|
||||
* Main layout
|
||||
*/
|
||||
#main-menu {
|
||||
float: left;
|
||||
|
||||
width: 125px;
|
||||
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2),
|
||||
0 9px 18px 0 rgba(0, 0, 0, 0.1);
|
||||
|
||||
margin: 20px 0 0 20px;
|
||||
padding: 20px 20px 20px 30px;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
min-height: 100px;
|
||||
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2),
|
||||
0 9px 18px 0 rgba(0, 0, 0, 0.1);
|
||||
|
||||
margin: 20px 20px 20px 220px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Login layout
|
||||
*/
|
||||
#login-container {
|
||||
width: 320px;
|
||||
height: 180px;
|
||||
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2),
|
||||
0 9px 18px 0 rgba(0, 0, 0, 0.1);
|
||||
|
||||
margin: 80px auto;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#login-container h1 {
|
||||
background-color: #cdcdcd;
|
||||
|
||||
text-align: center;
|
||||
|
||||
font-size: 24;
|
||||
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
#login {
|
||||
|
||||
}
|
||||
|
||||
#login-form {
|
||||
padding: 20px 20px;
|
||||
}
|
|
@ -1,3 +1,26 @@
|
|||
<h2 id="title">Welcome to Ember</h2>
|
||||
<header>
|
||||
<h1>VILLAS</h1>
|
||||
</header>
|
||||
|
||||
{{outlet}}
|
||||
{{#if session.isAuthenticated}}
|
||||
<div id="main-menu">
|
||||
<h2>Menu</h2>
|
||||
|
||||
<ul>
|
||||
<li>{{#link-to 'index'}}Home{{/link-to}}</li>
|
||||
<li>{{#link-to 'projects'}}Projects{{/link-to}}</li>
|
||||
<li>Preferences</li>
|
||||
<li><a {{action 'invalidateSession'}}>Logout</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<section id="wrapper">
|
||||
{{outlet}}
|
||||
</section>
|
||||
{{else}}
|
||||
{{outlet}}
|
||||
{{/if}}
|
||||
|
||||
<footer>
|
||||
Copyright © 2016
|
||||
</footer>
|
||||
|
|
1
app/templates/index.hbs
Normal file
1
app/templates/index.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>Main Content</h1>
|
19
app/templates/login.hbs
Normal file
19
app/templates/login.hbs
Normal file
|
@ -0,0 +1,19 @@
|
|||
<section id="login-container">
|
||||
<h1>Login</h1>
|
||||
|
||||
<form id="login-form" {{action 'authenticate' on='submit'}} >
|
||||
<p>
|
||||
<label for="username">Username</label>
|
||||
{{input id='username' placeholder='Enter username' value=username}}
|
||||
</p>
|
||||
<p>
|
||||
<label for="password">Password</label>
|
||||
{{input id='password' placeholder='Enter password' type='password' value=password}}
|
||||
</p>
|
||||
<button type="submit">Login</button>
|
||||
|
||||
{{#if errorMessage}}
|
||||
<p>{{errorMessage.message}}</p>
|
||||
{{/if}}
|
||||
</form>
|
||||
</section>
|
1
app/templates/project/delete.hbs
Normal file
1
app/templates/project/delete.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>Delete Project</h1>
|
1
app/templates/project/edit.hbs
Normal file
1
app/templates/project/edit.hbs
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>Edit {{model.name}}</h1>
|
4
app/templates/project/index.hbs
Normal file
4
app/templates/project/index.hbs
Normal file
|
@ -0,0 +1,4 @@
|
|||
<h1>{{model.name}}</h1>
|
||||
|
||||
{{#link-to "project.edit" model}}Edit project{{/link-to}}
|
||||
{{#link-to "project.delete" model}}Delete project{{/link-to}}
|
16
app/templates/project/new.hbs
Normal file
16
app/templates/project/new.hbs
Normal file
|
@ -0,0 +1,16 @@
|
|||
<h1>New project</h1>
|
||||
|
||||
<section id="project-new">
|
||||
<form id="project-new-form" {{action 'newProject' on='submit'}} >
|
||||
<p>
|
||||
<label for="name">Name</label>
|
||||
{{input id='name' placeholder='Enter project name' value=name}}
|
||||
</p>
|
||||
|
||||
<button type="submit">Create</button>
|
||||
|
||||
{{#if errorMessage}}
|
||||
<p>{{errorMessage.message}}</p>
|
||||
{{/if}}
|
||||
</form>
|
||||
</section>
|
9
app/templates/projects.hbs
Normal file
9
app/templates/projects.hbs
Normal file
|
@ -0,0 +1,9 @@
|
|||
<h1>Projects</h1>
|
||||
|
||||
<ul>
|
||||
{{#each model as |project|}}
|
||||
<li>{{#link-to "project.index" project.id}}{{project.name}}{{/link-to}}</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
{{#link-to "project.new"}}New project{{/link-to}}
|
|
@ -37,6 +37,7 @@
|
|||
"ember-export-application-global": "^1.0.5",
|
||||
"ember-load-initializers": "^0.5.1",
|
||||
"ember-resolver": "^2.0.3",
|
||||
"loader.js": "^4.0.1"
|
||||
"loader.js": "^4.0.1",
|
||||
"ember-simple-auth": "^1.1.0"
|
||||
}
|
||||
}
|
||||
|
|
12
tests/unit/adapters/application-test.js
Normal file
12
tests/unit/adapters/application-test.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('adapter:application', 'Unit | Adapter | application', {
|
||||
// Specify the other units that are required for this test.
|
||||
// needs: ['serializer:foo']
|
||||
});
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it exists', function(assert) {
|
||||
let adapter = this.subject();
|
||||
assert.ok(adapter);
|
||||
});
|
12
tests/unit/controllers/application-test.js
Normal file
12
tests/unit/controllers/application-test.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('controller:application', 'Unit | Controller | application', {
|
||||
// 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);
|
||||
});
|
12
tests/unit/controllers/login-test.js
Normal file
12
tests/unit/controllers/login-test.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('controller:login', 'Unit | Controller | login', {
|
||||
// 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);
|
||||
});
|
12
tests/unit/controllers/projects/new-test.js
Normal file
12
tests/unit/controllers/projects/new-test.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('controller:projects/new', 'Unit | Controller | projects/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);
|
||||
});
|
12
tests/unit/models/project-test.js
Normal file
12
tests/unit/models/project-test.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { moduleForModel, test } from 'ember-qunit';
|
||||
|
||||
moduleForModel('project', 'Unit | Model | project', {
|
||||
// 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);
|
||||
});
|
12
tests/unit/models/user-test.js
Normal file
12
tests/unit/models/user-test.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
import { moduleForModel, test } from 'ember-qunit';
|
||||
|
||||
moduleForModel('user', 'Unit | Model | user', {
|
||||
// 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);
|
||||
});
|
11
tests/unit/routes/application-test.js
Normal file
11
tests/unit/routes/application-test.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('route:application', 'Unit | Route | application', {
|
||||
// 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);
|
||||
});
|
11
tests/unit/routes/index-test.js
Normal file
11
tests/unit/routes/index-test.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('route:index', 'Unit | Route | 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);
|
||||
});
|
11
tests/unit/routes/login-test.js
Normal file
11
tests/unit/routes/login-test.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('route:login', 'Unit | Route | login', {
|
||||
// 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);
|
||||
});
|
11
tests/unit/routes/projects-test.js
Normal file
11
tests/unit/routes/projects-test.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('route:projects', 'Unit | Route | projects', {
|
||||
// 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);
|
||||
});
|
11
tests/unit/routes/projects/delete-test.js
Normal file
11
tests/unit/routes/projects/delete-test.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('route:projects/delete', 'Unit | Route | projects/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);
|
||||
});
|
11
tests/unit/routes/projects/edit-test.js
Normal file
11
tests/unit/routes/projects/edit-test.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('route:projects/edit', 'Unit | Route | projects/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);
|
||||
});
|
11
tests/unit/routes/projects/index-test.js
Normal file
11
tests/unit/routes/projects/index-test.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('route:projects/index', 'Unit | Route | projects/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);
|
||||
});
|
11
tests/unit/routes/projects/new-test.js
Normal file
11
tests/unit/routes/projects/new-test.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('route:projects/new', 'Unit | Route | projects/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);
|
||||
});
|
11
tests/unit/routes/projects/project-test.js
Normal file
11
tests/unit/routes/projects/project-test.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import { moduleFor, test } from 'ember-qunit';
|
||||
|
||||
moduleFor('route:projects/project', 'Unit | Route | projects/project', {
|
||||
// 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);
|
||||
});
|
15
tests/unit/serializers/application-test.js
Normal file
15
tests/unit/serializers/application-test.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { moduleForModel, test } from 'ember-qunit';
|
||||
|
||||
moduleForModel('application', 'Unit | Serializer | application', {
|
||||
// Specify the other units that are required for this test.
|
||||
needs: ['serializer:application']
|
||||
});
|
||||
|
||||
// Replace this with your real tests.
|
||||
test('it serializes records', function(assert) {
|
||||
let record = this.subject();
|
||||
|
||||
let serializedRecord = record.serialize();
|
||||
|
||||
assert.ok(serializedRecord);
|
||||
});
|
Loading…
Add table
Reference in a new issue