Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

kurko
Copy link
Contributor

@kurko kurko commented Dec 23, 2013

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?

});

AssertPersonPhones = async(function(record) {
equal(record.get('phones.length'), 1, "hasMany relationship saved correctly");
Copy link
Member

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.

Copy link
Member

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()

@igorT
Copy link
Member

igorT commented Dec 25, 2013

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");
Copy link
Contributor Author

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.

@kurko
Copy link
Contributor Author

kurko commented Dec 28, 2013

@fsmanuel
Copy link
Contributor

@kurko #1678 might me related

@GetContented
Copy link

@igorT Do you know if there's a schedule for SSOT?

@erikmuttersbach
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants