forked from thoughtbot/guides
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.js
More file actions
38 lines (29 loc) · 712 Bytes
/
Copy pathsample.js
File metadata and controls
38 lines (29 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
App.Post = DS.Model.extend({
author: DS.belongsTo('user'),
tags: DS.hasMany('tag'),
createdAt: DS.attr('date'),
title: DS.attr('string'),
});
test('checks the box', function() {
visit('/');
click('.check-box');
andThen(function() {
const checkBox = find('.check-box');
ok(checkBox.prop('checked'), 'box is checked');
});
});
import Ember from 'ember';
import DS from 'ember-data';
const { computed } = Ember;
const { attr, hasMany, belongsTo } = DS;
export default DS.Model.extend({
name: attr('string'),
...
});
import Ember from 'ember';
export default Ember.Route.extend({
ajax: Ember.inject.service(),
model() {
return this.get('ajax').request('/posts');
}
});