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

Transition an invalid created record to the deleted saved state when … #4293

Merged
merged 1 commit into from
Apr 9, 2016

Conversation

bmac
Copy link
Member

@bmac bmac commented Mar 31, 2016

…deleted.

Closes #4289

assert.equal(get(record, 'currentState.stateName'), 'root.deleted.saved');
assert.equal(get(store.peekAll('person'), 'length'), 0, 'The new person should be removed from the store');
});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: any specific reason why this is not in tests/integration/records/delete-record-test.js?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. I will move it.


assert.equal(get(record, 'currentState.stateName'), 'root.deleted.saved');
assert.equal(get(store.peekAll('person'), 'length'), 0, 'The new person should be removed from the store');
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test case for destroyRecord too? I think this fix should also work for #3688.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test case for destroyRecord.

@pangratz
Copy link
Member

pangratz commented Apr 2, 2016

Looks good 👍

Tiny nitpick: I would prefer using the adapter instead of store.recordWasInvalid so the whole stack is run through, which might make this tests more robust for eventual future changes. But again, this is just my personal preference. Current approach is fine too 😃 .

@bmac
Copy link
Member Author

bmac commented Apr 9, 2016

@pangratz I've updated the test for this pr to not use the private store.recordWasInvalid method.

@pangratz
Copy link
Member

pangratz commented Apr 9, 2016

Nice @bmac, feel free to merge once 🍏

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.

None yet

2 participants