{"action":"closed","issue":{"url":"https://api.github.com/repos/HashNuke/hound/issues/34","labels_url":"https://api.github.com/repos/HashNuke/hound/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/HashNuke/hound/issues/34/comments","events_url":"https://api.github.com/repos/HashNuke/hound/issues/34/events","html_url":"https://github.com/HashNuke/hound/issues/34","id":85899544,"number":34,"title":"Response from phantomjs isn't processed properly","user":{"login":"sevenseacat","id":543859,"avatar_url":"https://avatars.githubusercontent.com/u/543859?v=3","gravatar_id":"","url":"https://api.github.com/users/sevenseacat","html_url":"https://github.com/sevenseacat","followers_url":"https://api.github.com/users/sevenseacat/followers","following_url":"https://api.github.com/users/sevenseacat/following{/other_user}","gists_url":"https://api.github.com/users/sevenseacat/gists{/gist_id}","starred_url":"https://api.github.com/users/sevenseacat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sevenseacat/subscriptions","organizations_url":"https://api.github.com/users/sevenseacat/orgs","repos_url":"https://api.github.com/users/sevenseacat/repos","events_url":"https://api.github.com/users/sevenseacat/events{/privacy}","received_events_url":"https://api.github.com/users/sevenseacat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-07T12:53:15Z","updated_at":"2015-06-07T15:32:13Z","closed_at":"2015-06-07T15:32:13Z","body":"Testing from the `refactor` branch. \r\n\r\nThe problem is the initial response from `:find_or_create_session`. As it is, I get the following error:\r\n\r\n```\r\n  1) test Users can create new projects (CreateProject)\r\n     test/features/create_project_test.exs:7\r\n     ** (exit) exited in: :gen_server.call(Hound.SessionServer, {:find_or_create_session, #PID<0.346.0>}, 60000)\r\n         ** (EXIT) an exception was raised:\r\n             ** (Poison.SyntaxError) Unexpected end of input\r\n                 (poison) lib/poison/parser.ex:54: Poison.Parser.parse!/2\r\n                 (poison) lib/poison.ex:83: Poison.decode!/2\r\n                 (hound) lib/hound/response_parsers/phantom_js.ex:5: Hound.ResponseParsers.PhantomJs.parse/3\r\n                 (hound) lib/hound/request_utils.ex:50: Hound.RequestUtils.send_req/4\r\n                 (hound) lib/hound/session_server.ex:22: Hound.SessionServer.handle_call/3\r\n                 (stdlib) gen_server.erl:607: :gen_server.try_handle_call/4\r\n                 (stdlib) gen_server.erl:639: :gen_server.handle_msg/5\r\n                 (stdlib) proc_lib.erl:237: :proc_lib.init_p_do_apply/3\r\n```\r\n\r\nWith the test specified here: https://github.com/sevenseacat/ticketee-phoenix/blob/master/test/features/create_project_test.exs\r\n\r\nAfter some debugging, it turns out that the params being passed to `Hound.ResponseParsers.PhantomJs.parse/3` are `\"session\", 303, \"\"`. Further up the call chain, the response from `{:ok, resp} = HTTPoison.post(url, body, headers)` is as follows:\r\n\r\n```\r\npry(1)> resp\r\n%HTTPoison.Response{body: \"\",\r\n headers: [{\"Cache\", \"no-cache\"},\r\n  {\"Content-Type\", \"application/json;charset=UTF-8\"},\r\n  {\"Location\",\r\n   \"http://localhost:8910/wd/hub/session/bff36540-0d12-11e5-af7d-d7e9deddf01f\"}],\r\n status_code: 303}\r\n```\r\n\r\nIt seems like the session ID is being returned as part of the location header, not as part of the content of the page to be parsed in the `parse/3` method. This was tested with both PhantomJs 1.8.2 and 2.0.0."}}