-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add integration tests for CRUD with pretender #18
Conversation
8ee2e66
to
d408e7b
Compare
Alright, finally some progress. :) |
d408e7b
to
5dd9201
Compare
@@ -3,7 +3,7 @@ import Ember from 'ember'; | |||
|
|||
export default DS.RESTAdapter.extend({ | |||
|
|||
defaultSerializer: "DS/djangoREST", | |||
defaultSerializer: "-drf", |
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.
What does -drf
mean?
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.
drf is for django rest framework. I'm not exactly sure if this is correct; I'm just following format from the docs and the active model adapter.
http://emberjs.com/guides/models/customizing-adapters/#toc_authoring-adapters
https://github.com/emberjs/data/blob/master/packages/activemodel-adapter/lib/system/active_model_adapter.js#L104
I guess '-django-rest' or '-django' could also work. Or does it need to be 'DS/djangoREST' for some reason?
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 don't think the preceding hyphen is necessary. This is how I did it in the current v0.4.0 version: https://github.com/dustinfarris/ember-django-adapter/blob/master/app/adapters/django.js#L4 which corresponds to the django serializer (identified by filename) here: https://github.com/dustinfarris/ember-django-adapter/tree/master/app/serializers
Right now in the version-1.0 branch we just have an "application" adapter and an "application" serializer which means this line isn't necessary because Ember will choose those by default anyway. This may not be the right way to go, though, and perhaps we should continue doing it the way I did it in master, which would be to move app/serializers/application.js
to app/serializers/drf.js
and then change this line to defaultSerializer: 'drf'
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.
It looks like the preceding hyphen is used because ember data specifically registered it with that name:
My guess is that it is intended to prevent name clashing.
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.
Ok, so should I remove the defaultSerializer line or just revert this change back to the original value in the version-1.0 branch?
Great start here! Pretender looks very promising. |
Just remove for now. We can address how we want to make the serializer available in a different PR. |
a6a3a11
to
6d0917b
Compare
39d2808
to
9c0d12b
Compare
33a22a2
to
f5cc7bb
Compare
@dustinfarris I'm still poking away at this but I'll let you know when I think it's ready for a review ... probably after your unittest PR is merged. |
f5cc7bb
to
33db894
Compare
Maybe the new version of Ember is causing this failure. I'll investigate tomorrow. |
8af137e
to
bfa7fa4
Compare
|
Sorry, I was reading the diff wrong. So you have created |
bfa7fa4
to
a97bec0
Compare
@benkonrath any luck with this? |
When I remove My latest commit adds the |
This commit also includes the configuration for pretender.
4bbd096
to
043757f
Compare
I forgot to mention: The nice thing about this latest version is that I no longer add the adapter to the dummy app. So I think I'm on the right track now with the host issue with Pretender. |
Awesome! Is there anything else outstanding before this can be merged? |
I just created an issue #33 so I don't forget about the issue with setting the empty host in the integration tests. I think it's good to go. |
Add integration tests for CRUD with pretender
No description provided.