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

using .andFail with a status that isn't an error code #115

Closed
ismay opened this issue Jul 28, 2015 · 6 comments
Closed

using .andFail with a status that isn't an error code #115

ismay opened this issue Jul 28, 2015 · 6 comments

Comments

@ismay
Copy link

ismay commented Jul 28, 2015

When using:

handleUpdate().andFail({
  status: 304 // won't fail
})

the update doesn't fail if the status code isn't an error code. Now this makes sense, but it would help with debugging if ember-data-factory-guy threw an error when using status codes that aren't actual error status codes. I took quite some time to figure that this was why the request wasn't failing.

@pgvandelden

@danielspaniel
Copy link
Collaborator

This is a funny one actually .. because I never thought anyone would do that .. but sure .. why not ..
If you have any time .. do you feel like doing a pull request to add this? If not I can do it .. but it might take a while, since I have a few other issues that are before this and are nagging me

@ismay
Copy link
Author

ismay commented Jul 30, 2015

Yeah it's clearly a user error. But how would you prefer ember-data-factory-guy to handle this? Do you think it should throw an error when anything but an error status code is used?

@danielspaniel
Copy link
Collaborator

Yes, that would be the way to do it .. that way they see the error and tests stop right there.

@ismay
Copy link
Author

ismay commented Aug 4, 2015

Ok cool. I won't have time to work on this anytime soon, but if it's not too late I can submit a PR in about two weeks.

@danielspaniel
Copy link
Collaborator

That is fine @ismay .. get to it when you can.

@danielspaniel
Copy link
Collaborator

v2.6.4 adds this check for only setting 4XX and 5XX values for status options on a fails() method call

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

No branches or pull requests

2 participants