-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
.match() for mockUpdate() #216
Comments
err .. um .. well .. let's see, I am digging through my thoughts for this one, and the answer is? but you know, it's not a bad idea might be easy to do you want to take a shot at it? |
I'll see if I can make a PR with at least some tests. |
v2.7.0-beta.10 has this ability |
@cristinawithout => side note. I thought this was a pretty silly feature at first, and lo and behold as soon as I finished it, I used it right away 👍 seems to happen every time I get a feature request. I kind of think ( who would ever need that ). Then it ends up being me using it pretty much the next day. In fact I even wrote up something in Tips and Tricks because of this very feature |
👍 Nice. I'm using it along with mockJack's throwUnmocked:true in acceptance tests to make sure A. all the form inputs are hooked up to the buffered model (our own implementation similar to buffered proxy - but handles relationships) B. the values in the buffered model transfer to the model on save C. The values are serializing as expected. Using match(), I can make sure all of those things are working. Without it, the update would return success, and the test would pass even if the the model wasn't connected to the inputs and/or the serializer was returning nothing. An update acceptance test where I'm using it is basically like this:
|
@danielspaniel Does this work for |
@mdentremont: only mockUpdate and mockCreate has the concept of match attributes. |
@danielspaniel Sorry, I was referring to the |
Oops .. yes, timesCalled is available to all the mocks .. and your right .. it was not available to mockCreate until I refactored it to use the same base class at all requests |
@danielspaniel Awesome, that is great news! |
I don't see a way to verify the data sent to my endpoint on update is correct as I can with mockCreate().match()
The text was updated successfully, but these errors were encountered: