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

Behat payload results in 422 Unprocessable Entity #9

Open
lowerends opened this issue Jul 10, 2014 · 1 comment
Open

Behat payload results in 422 Unprocessable Entity #9

lowerends opened this issue Jul 10, 2014 · 1 comment

Comments

@lowerends
Copy link

I bought Phil's book today and must say it's a good read.

I'm currently writing Behat tests for my API and want to try testing a post with a payload. I have a scenario like this:

Given I have the payload:
        """
        {"name": "foo_name"}
        """
When I request "POST /api/users"
Then I get a "200" response

When running the test, it seems the payload is not sent. Debugging learns that Input::get('name') in my store() function returns 422 Unprocessable Entity.

Other test, without payload, are running fine. Posting the same payload in Chrome's RestClient does work correctly.

Any ideas on what's going on here?

Thanks

@centerax
Copy link

centerax commented Dec 1, 2014

@lowerends Have you tried editing to ->$method($resource, array('body' => $this->requestPayload)); ?

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