title: Rails 4 rspec UrlGenerationError
body: <p>I am testing a Rails app that has been upgraded to Rails 4.2 using rspec 3.4.1. In this app I have the following route (as printed by <code>rake routes</code>):</p>
  
  <pre><code>contact_g  GET /foo/contact/:legs_trip_id/:user_id(.:format)
             foo#find_edit { :trip_type_id=&gt;"123", :user_id=&gt;"0", :locale=&gt;"en", :format=&gt;/html|js|json/, :legs_trip_id=&gt;/\d+/}
  </code></pre>
  
  <p>In my app, in development and production modes, this route works fine. But in tests I get the following error when trying to use the route. Example spec:</p>
  
  <pre><code>describe "#find_edit, logged in:" do
  before do
    @c1 = mock_model(Foo, :id =&gt; 1059)
    # mock a User, set up session and expectations to mimick a logged in user
    @u = pseudo_login
  end
  it "..." do
    expect(@u).to receive # ...
    get :find_edit, :legs_trip_id =&gt; "123", :pn_id =&gt; 252, :sa_id =&gt; 1923, :email =&gt; 1, :ee_id =&gt; "bla", :trip_type_id =&gt; "123", user_id: @u.id
    expect(response).to redirect_to(...)
  end
  </code></pre>
  
  <p>As a controller test, at the "get" line rspec throws this error:</p>
  
  <pre><code>ActionController::UrlGenerationError:
     No route matches { :action=&gt;"find_edit", :controller=&gt;"foo", :ee_id=&gt;"bla", :email=&gt;"1", :legs_trip_id=&gt;"123", :pn_id=&gt;"252", :sa_id=&gt;"1923", :trip_type_id=&gt;"123", :user_id=&gt;"19" }
  </code></pre>
  
  <p>As a feature or integration specI  can't access <code>request.session</code> to login my mocked user and thus can't get the tests to start at all:</p>
  
  <pre><code>   undefined local variable or method `request' for #&lt;RSpec::ExampleGroups::FindingByLTAndUserIDFindEditLoggedIn:...&gt;
  </code></pre>
  
  <p>in this helper code that is called during spec setup:</p>
  
  <pre><code>request.session[:user_id] = mocked_user.id
  </code></pre>
  
  <p>How can I run these specs? It used to work in Rails 3.x.</p>