-
Notifications
You must be signed in to change notification settings - Fork 156
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
Fixing tests for Ember Data 1.0.0-beta.5 #30
Conversation
@fivetanley @rpflorence ping |
// 1. findMany is a private method | ||
// 2. DS.FixtureAdapter doesn't test it directly | ||
// test('findMany', function() { | ||
// lists = store.findMany('list', Ember.A(['l1', 'l3']), App.List); |
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.
I'm still struggling with this test. Can't make it pass nor understand why. Basically, ED throws all sorts of errors.
I'm thinking about removing this test, given no other adapter tests it directly. Then I'll probably Unit test the method in another test namespace.
|
||
store = DS.Store.create({adapter: adapter}); | ||
// 1. findMany is a private method | ||
// 2. DS.FixtureAdapter doesn't test it directly |
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.
I agree with these statements as being pretty good reasons to just delete this test and check off "Fix findMany() tests (this one is tough)".
For "Refactor crazy helpers", is there anything in particular you are looking for? I just deleted a bunch of unused stuff. I figure it's ok-ish now (see carnesmedia/ember-localstorage-adapter@22cf6d162fa87f70175be9e397ae4fb4e5b00011) |
Yeah, I'd remove the helpers that make reading tests harder. I personally don't like Regardless of that, I think these changes in the helpers are definitely not as important as making the tests pass. I'll trust your judgement on this one. |
FYI: there are a bunch of changes in kurko#1 |
Improve relationships saving/loading
Thanks for the hard work, @amiel! Are the tests passing? (I'm going to download it tonight and run them) |
… a model hadn't already been added.
Fix to handle when localStorage hasn't been initialized
Ok, so I unchecked |
Guys, good news! All tests are finally passing locally. I want to thank @amiel and @bjarkehs immensely for the hard work. After all this coordinated effort, seeing the final result is what makes me love open source. Now, before merging, I'd like to ask you guys to review this code. Also, we need to change the README with things like "{async: true}" is not needed and some other things. It's late here, so I won't do it now. I'm also going to push a fix for the Thank you. |
Although fixing TravisCI is out of the scope of this PR, merging the runner.js file into master wouldn't serve us anything, given all tests are failing. |
Is there anything left to do for this pull-request? |
I'll review it tonight and then update the README. |
} | ||
}, | ||
|
||
extractSingle: function(store, type, payload) { |
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.
We should probably add a comment here on why we're extracting it the way we're doing it.
To everyone helping out, you have my deepest gratitude. I'll give this a formal review as soon as I can, hopefully tomorrow morning before work. I am so happy tears are running down my face. |
… the model isn't added to localStorage already
Issues with localStorage when empty and when creatingRecords
I'm not sure if this is a bug with the adapter or my code, but I'm getting the error:
In order for this to make sense I have the following models defined:
I'd think that since everything is local we might as well fetch it all? When I console.log the order object I can access the hours through _data and then hours, so I'm not entirely sure where it goes wrong. Anyone with some insight on this? |
Fixing tests for Ember Data 1.0.0-beta.5
Merged this. Finding new issues and opening PRs will be easier now. I copied master into a branch called @bjarkehs is that error occurring in the tests? If so, have you registered the |
This PR has a bunch of changes required to work with the new architecture used since ED entered beta.
find()
testsfindMany()
tests (this one is tough)findQuery()
testsfindAll()
testscreateRecord()
testsupdateRecord()
testsdeleteRecords()
testsbulkCommits()
tests (not sure this one is needed anymore)load has many
testsload belongs to
testssave relationship
testsRefactor crazy helpers