{"issue":{"created_at":"2011-11-04T01:10:11Z","state":"open","updated_at":"2011-11-28T00:56:58Z","comments":1,"user":{"gravatar_id":"78b17d58791976b82b7b986228cbfe95","id":97204,"url":"https://api.github.com/users/willrjmarshall","login":"willrjmarshall","avatar_url":"https://secure.gravatar.com/avatar/78b17d58791976b82b7b986228cbfe95?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"I'm having a strange issue using Capybara-webkit with Rspec 2.\r\n\r\nI have a \"before do\" block that looks like this:\r\n\r\n```ruby\r\n    before do\r\n      visit \"/\"\r\n      click_link \"Log in\"\r\n      fill_in \"Email\", :with => user.email\r\n      fill_in \"Password\", :with => \"password\" \r\n      click_button \"Sign in\"\r\n    end\r\n\r\n    it \"should show me a link to my profile on the home page\" do\r\n      visit \"/\"\r\n      page.should have_content \"My profile\"\r\n    end\r\n```\r\n\r\nThis fails, as the login is not completed (although it should work).\r\n\r\nHowever, if I access the page object at the end of the before block, e.g.\r\n\r\n    page.should_not have_content \"NOTONTHEPAGE\"\r\n\r\nThen the login succeeds and this test passes.\r\n\r\nIt looks like Capybara-webkit requests aren't actually being run until the page object is accessed...","assignee":null,"id":2139838,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":205,"labels":[],"title":"Tests fail unless page object is accessed","closed_at":null,"html_url":"https://github.com/thoughtbot/capybara-webkit/issues/205","milestone":null,"url":"https://api.github.com/repos/thoughtbot/capybara-webkit/issues/205"},"action":"created","comment":{"created_at":"2011-11-28T00:56:58Z","updated_at":"2011-11-28T00:56:58Z","user":{"gravatar_id":"3bec49196b296ac7c201412642c7a2b1","id":22678,"url":"https://api.github.com/users/Papipo","login":"Papipo","avatar_url":"https://secure.gravatar.com/avatar/3bec49196b296ac7c201412642c7a2b1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Have you tried to click on a link to the homepage instead of using visit() in the example?\r\n\r\nIt happened to me in the past, that if you use visit() after signing in, the session is lost.","id":2891531,"url":"https://api.github.com/repos/thoughtbot/capybara-webkit/issues/comments/2891531"}}