{"action":"opened","issue":{"url":"https://api.github.com/repos/teampoltergeist/poltergeist/issues/776","repository_url":"https://api.github.com/repos/teampoltergeist/poltergeist","labels_url":"https://api.github.com/repos/teampoltergeist/poltergeist/issues/776/labels{/name}","comments_url":"https://api.github.com/repos/teampoltergeist/poltergeist/issues/776/comments","events_url":"https://api.github.com/repos/teampoltergeist/poltergeist/issues/776/events","html_url":"https://github.com/teampoltergeist/poltergeist/issues/776","id":160872870,"number":776,"title":"Unintuitive behaviour of `page.status_code`","user":{"login":"danyalaytekin","id":1315042,"avatar_url":"https://avatars.githubusercontent.com/u/1315042?v=3","gravatar_id":"","url":"https://api.github.com/users/danyalaytekin","html_url":"https://github.com/danyalaytekin","followers_url":"https://api.github.com/users/danyalaytekin/followers","following_url":"https://api.github.com/users/danyalaytekin/following{/other_user}","gists_url":"https://api.github.com/users/danyalaytekin/gists{/gist_id}","starred_url":"https://api.github.com/users/danyalaytekin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danyalaytekin/subscriptions","organizations_url":"https://api.github.com/users/danyalaytekin/orgs","repos_url":"https://api.github.com/users/danyalaytekin/repos","events_url":"https://api.github.com/users/danyalaytekin/events{/privacy}","received_events_url":"https://api.github.com/users/danyalaytekin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-17T12:00:17Z","updated_at":"2016-06-17T12:00:17Z","closed_at":null,"body":"We have a feature:\r\n\r\n```\r\n@smoke @acceptance\r\nScenario: Home page is available\r\n  When I visit the home page url\r\n  Then I expect no error code\r\n```\r\n\r\nWith the final line implemented as:\r\n\r\n```\r\nThen(/^I expect no error code$/) do\r\n  expect(page.status_code).to eq 200\r\nend\r\n```\r\n\r\nThis sometimes fails.  When debugging we've found the following:\r\n\r\n- the page itself _always_ responds with `200`\r\n- however, one resource within the page sometimes responds with `204` (which causes the test to fail)\r\n\r\nThis suggests that `page.status_code` does not equal the status code of the actual URL requested, but could be set to the status code of any (or presumably the last?) of the resources requested by the page.\r\n\r\nIs this the correct explanation, and is it the expected behaviour of `page.status_code`?\r\n\r\nNotes:\r\n\r\n- I realise that `204` could be construed as success, but this is not the focus of this issue\r\n"}}
{"actor":{"display_login":"danyalaytekin"}}