this wait_for_page call made me curious - this not valid capybara. And indeed: you patched a block that is within "if false" starting line 97