title: Change Rails session for tests with Capybara
body: <p>I need to test a page in my Rails 5.2 app that displays the current cart if the user is not logged with Capybara system test. The app retrieves the cart by the <code>card_id</code> saved in the rails session (<code>session[:cart_id] = @cart.id)</code></p>
  
  <p>My test looks like this:</p>
  
  <pre class="lang-rb prettyprint-override"><code>require 'application_system_test_case'
  
  class CartUiTest &lt; ApplicationSystemTestCase
    def setup
      @cart = create(:cart)
    end
  
    test 'show cart also if user is not logged' do
      visit edit_cart_path
  
      assert_text "Some text"
    end
  end
  
  </code></pre>
  
  <p>How can I set the session in this test? I've tried the gem <a href="https://github.com/railsware/rack_session_access" rel="nofollow noreferrer">rack_session_access</a> but I'm looking for another solution that not use this gem because it conflicts with other tests.</p>