-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83f25cc
commit dcb3150
Showing
1 changed file
with
4 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -604,18 +604,15 @@ module('Unit | Model | fake-model', function (hooks) { | |
|
||
module('Relations validations', function () { | ||
module('`hasMany` relations', function () { | ||
test('it validates the relations specified on `validations.relations`', function (assert) { | ||
test('it validates the relations specified on `validations.relations`', async function (assert) { | ||
assert.expect(1); | ||
const store = this.owner.lookup('service:store'); | ||
const model = store.createRecord('fake-model', { email: '[email protected]', name: 'Jose Rene Higuita' }); | ||
|
||
let otherFakes = model.get('otherFakes'); | ||
let otherFakes = await model.otherFakes; | ||
const otherFake = store.createRecord('other-model'); | ||
if (otherFakes.push) { | ||
otherFakes.push(otherFake); | ||
} else { | ||
otherFakes.pushObject(otherFake); | ||
} | ||
|
||
otherFakes.push(otherFake); | ||
|
||
assert.false(model.validate({ only: ['otherFakes'] })); | ||
}); | ||
|