-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug/failing test: FixtureAdapter doesn't save hasMany records #1606
Conversation
}); | ||
|
||
AssertPersonPhones = async(function(record) { | ||
equal(record.get('phones.length'), 1, "hasMany relationship saved correctly"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't do record.get('phones.length') because phones is an async hasMany, it returns a promise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the reason the test is failing, it seems like phones are not there even before you do tom.save()
I think this might be fixed be fixed soon by the work on the single-source-of-truth branch. |
This failing test proves a bug exists when a record is created in the store with a hasMany relationships. The relationships are simply lost upon `phones.createRecord('name', {person: tom})`, where `tom` is the record that has `phones`.
|
||
stop(); | ||
tom.get('phones').then(function(p) { | ||
equal(p.get('length'), 1, "hasMany relationships are created in the store"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@igorT ping. Rewrote this. In fact, the relationship is lost right here.
I tried to add |
@igorT Do you know if there's a schedule for SSOT? |
Whats the status of the broken hasMany relationships with the fixture adapter? It seems you cannot actually use it to run tests now ... it's a catastrophe. |
This PR has one commit that adds a failing test to prove that a bug exists
when a record is saved with hasMany relationships. The relationships are
simply lost upon
record.createRecord()
.Could someone help me in fixing this?