{"action":"created","issue":{"url":"https://api.github.com/repos/api-platform/api-platform/issues/197","repository_url":"https://api.github.com/repos/api-platform/api-platform","labels_url":"https://api.github.com/repos/api-platform/api-platform/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/api-platform/api-platform/issues/197/comments","events_url":"https://api.github.com/repos/api-platform/api-platform/issues/197/events","html_url":"https://github.com/api-platform/api-platform/issues/197","id":197625083,"number":197,"title":"Errors while testing with Behat","user":{"login":"renan-taranto","id":10513720,"avatar_url":"https://avatars.githubusercontent.com/u/10513720?v=3","gravatar_id":"","url":"https://api.github.com/users/renan-taranto","html_url":"https://github.com/renan-taranto","followers_url":"https://api.github.com/users/renan-taranto/followers","following_url":"https://api.github.com/users/renan-taranto/following{/other_user}","gists_url":"https://api.github.com/users/renan-taranto/gists{/gist_id}","starred_url":"https://api.github.com/users/renan-taranto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renan-taranto/subscriptions","organizations_url":"https://api.github.com/users/renan-taranto/orgs","repos_url":"https://api.github.com/users/renan-taranto/repos","events_url":"https://api.github.com/users/renan-taranto/events{/privacy}","received_events_url":"https://api.github.com/users/renan-taranto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-26T22:56:29Z","updated_at":"2016-12-27T15:41:26Z","closed_at":null,"body":"After following the Get Started tutorial (and facing #192, that may be related to this) I went to the section [Testing and Specifying the API](https://api-platform.com/docs/distribution/testing), copied and pasted the feature file and got 404 errors for all scenarios, eg:\r\n\r\n    Scenario: Retrieve the book list\r\n      When I add \"Accept\" header equal to \"application/ld+json\"\r\n      And I send a \"GET\" request to \"/books\"\r\n      Then the response status code should be 200\r\n        Current response status code is 404, but 200 expected. (Behat\\Mink\\Exception\\ExpectationException)\r\n\r\nI also noticed that the only URI that does not returns 404 while using behat is the entrypoint, and instead of returning the json (which is what I get from Postman actually):\r\n\r\n    {\r\n      \"@context\": \"/contexts/Entrypoint\",\r\n      \"@id\": \"/\",\r\n      \"@type\": \"Entrypoint\",\r\n      \"review\": \"/reviews\",\r\n      \"book\": \"/books\"\r\n    }\r\n\r\nit returns the following even after clearing the cache:\r\n\r\n    The json is equal to:\r\n      {\r\n          \"@context\": \"\\/contexts\\/Entrypoint\",\r\n          \"@id\": \"\\/\",\r\n          \"@type\": \"Entrypoint\"\r\n      } (Behat\\Mink\\Exception\\ExpectationException)`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/api-platform/api-platform/issues/comments/269342101","html_url":"https://github.com/api-platform/api-platform/issues/197#issuecomment-269342101","issue_url":"https://api.github.com/repos/api-platform/api-platform/issues/197","id":269342101,"user":{"login":"renan-taranto","id":10513720,"avatar_url":"https://avatars.githubusercontent.com/u/10513720?v=3","gravatar_id":"","url":"https://api.github.com/users/renan-taranto","html_url":"https://github.com/renan-taranto","followers_url":"https://api.github.com/users/renan-taranto/followers","following_url":"https://api.github.com/users/renan-taranto/following{/other_user}","gists_url":"https://api.github.com/users/renan-taranto/gists{/gist_id}","starred_url":"https://api.github.com/users/renan-taranto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renan-taranto/subscriptions","organizations_url":"https://api.github.com/users/renan-taranto/orgs","repos_url":"https://api.github.com/users/renan-taranto/repos","events_url":"https://api.github.com/users/renan-taranto/events{/privacy}","received_events_url":"https://api.github.com/users/renan-taranto/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T15:41:26Z","updated_at":"2016-12-27T15:41:26Z","body":"It turns out that I had to clear the `test` environment cache since its defined in behat.yml:\r\n\r\n    extensions:\r\n      Behat\\Symfony2Extension:\r\n        kernel:\r\n          env: \"test\"\r\n          debug: \"true\"\r\n\r\n404 errors are gone, but I still cant get green tests using the `feature` file provided in [Testing and Specifying the API](https://api-platform.com/docs/distribution/testing) since the Json Response comes with backslashes before forward slashes.\r\nI believe that the `feature` file should be updated because:\r\n  - Backslashes are expected;\r\n  - The need of clearing the `test` environment cache should be mentioned;\r\n  - The raw id property of the entities are also being serialized.\r\n\r\nI will create a pull request in the docs repo and I'm not sure if I should close this issue."}}
{"actor":{"display_login":"renan-taranto"}}