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

adding a store with METHOD doesn't make sense #30

Closed
justinbmeyer opened this issue Apr 13, 2016 · 2 comments · Fixed by #111
Closed

adding a store with METHOD doesn't make sense #30

justinbmeyer opened this issue Apr 13, 2016 · 2 comments · Fixed by #111
Assignees

Comments

@justinbmeyer
Copy link
Contributor

fixture("GET /todos/{id}", store) causes strange behavior.

@justinbmeyer justinbmeyer added this to the 0.4.1 milestone May 5, 2016
@justinbmeyer justinbmeyer removed this from the 0.4.1 milestone Sep 16, 2016
@andrejewski
Copy link
Contributor

Clarifying: a call to fixture('GET /models/{id}', store.getData); is the proper way to apply this fixture and we should add an error if fixture is called with a non-function (e.g. store)? Or does fixture accept objects so we should warn about store being store-like?

@justinbmeyer
Copy link
Contributor Author

fixture("/todos/{id}", store) is the right way to call with a store. It shouldn't have a get because this is going to setup a POST /todos, GET /todos, PUT /todos/{id}, GET /todos/{id}, DELETE /todos/{id}.

Normally the 1st argument is converted to an ajaxSettings object. That happens if it's a string around here:

https://github.com/canjs/can-fixture/blob/master/core.js#L40

This fix should probably change should probably make it so that ajaxSettings conversion always happens. Then, if there's a method, we should probably give people a warning.

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

Successfully merging a pull request may close this issue.

2 participants