You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert.equal(player.get('levelName'), 'Professional', 'new level is called professional');
48
+
});
51
49
});
52
50
```
53
51
52
+
Also note, how both creating a record and updating properties on the record through the `levelUp` method requires
53
+
us to wrap these operations into a `run` function. You can read more the Ember run loop [over here](https://guides.emberjs.com/v2.18.0/applications/run-loop/).
54
+
54
55
## Testing Relationships
55
56
56
57
For relationships you probably only want to test that the relationship
@@ -77,24 +78,25 @@ export default Model.extend({
77
78
});
78
79
```
79
80
80
-
Then you could test that the relationship is wired up correctly
81
-
with this test.
81
+
Then you could test that the relationship by looking it up on the `user` model which it is part of.
82
82
83
83
```tests/unit/models/user-test.js
84
-
import { moduleForModel, test } from'ember-qunit';
85
-
import { get } from'@ember/object';
84
+
import { module, test } from'qunit';
85
+
import { setupTest } from'ember-qunit';
86
+
import { get } from"@ember/object"
86
87
87
-
moduleForModel('user', 'Unit | Model | user', {
88
-
// Specify the other units that are required for this test.
0 commit comments