Try to prefer :css selector for capybara, as they are way more easy to handle and to understand. Better give some object explicit class nesting, to identify it via css rather than xpath