title: Running minitest controller get ActionController::UrlGenerationError: No route matches
body: <p>I know, that with this topic more questions asket, but i don't found what i need.</p>
  
  <p>Currently i'm updating rails app from 3.2.13 to 4.2.0 and after upgrading rails naturally fails tests. These tests are passed in 3.2.13</p>
  
  <p>So, i have this route:</p>
  
  <pre><code>get '/catalogs/:article_id/get_applicability_by_brand/:brand_id', :to =&gt; 'catalogs#get_applicability_by_brand', constrains: { format: 'js' }, as: :catalog_get_applicability_by_brand
  </code></pre>
  
  <p>Result of rake routes like this:</p>
  
  <pre><code>  catalog_get_applicability_by_brand GET /catalogs/:article_id/get_applicability_by_brand/:brand_id(.:format)                                                   catalogs#get_applicability_by_brand {:constrains=&gt;{:format=&gt;"js"}}
  </code></pre>
  
  <p>Controller action, it only render js.erb template:</p>
  
  <pre><code>  def get_applicability_by_brand
        @applicability = CatalogAccess::TecDoc.get_applicability_by_brand(params[:article_id], params[:brand_id])
    end
  </code></pre>
  
  <p>Minitest controller test:</p>
  
  <pre><code>      def test_get_applicability_by_brand_action
      expected_applicability = [
        { 'model_name' =&gt; 'Model 1',
          'name' =&gt; 'fake name',
          'year_of_construct_from' =&gt; '2000',
          'year_of_construct_to' =&gt; '2010',
          'construction_type' =&gt; 'fake type' },
        { 'model_name' =&gt; 'Model 1',
          'name' =&gt; 'fake name 2',
          'year_of_construct_from' =&gt; '1991',
          'year_of_construct_to' =&gt; '2005',
          'construction_type' =&gt; 'fake type' }
      ]
      CatalogAccess::TecDoc.expects(:get_applicability_by_brand).with('12', '23').returns expected_applicability
      xhr :get, :get_applicability_by_brand, :article_id =&gt; '12', :brand_id =&gt; '23', :format =&gt; "js"
      assert_response 200
      assert_template 'get_applicability_by_brand'
      assert_template :partial =&gt; '_tecdoc2_applicability'
    end
  </code></pre>
  
  <p>Test error message is:</p>
  
  <pre><code>ActionController::UrlGenerationError:         ActionController::UrlGenerationError: No route matches {:action=&gt;"get_applicability_by_brand", :article_id=&gt;"12", :brand_id=&gt;"23", :controller=&gt;"catalogs", :format=&gt;"js"}
  </code></pre>
  
  <p>I found that if append to my test option 'use_route', it will be pass, but get warning that seems not good solution</p>
  
  <pre><code>xhr :get, :get_applicability_by_brand, :article_id =&gt; '12', :brand_id =&gt; '23', :format =&gt; "js", :use_route =&gt; 'catalogs'
  </code></pre>
  
  <p>Warning message:</p>
  
  <pre><code>DEPRECATION WARNING: You are trying to generate the URL for a named route called "catalogs" but no such route was found. In the future, this will result in an `ActionController::UrlGenerationError` exception. (called from test_get_applicability_by_brand_action at /home/sdilshod/webapp/ps_base/apps/www/test/controllers/catalogs_controller_test.rb:627)
  DEPRECATION WARNING: Passing the `use_route` option in functional tests are deprecated. Support for this option in the `process` method (and the related `get`, `head`, `post`, `patch`, `put` and `delete` helpers) will be removed in the next version without replacement. Functional tests are essentially unit tests for controllers and they should not require knowledge to how the application's routes are configured. Instead, you should explicitly pass the appropiate params to the `process` method. Previously the engines guide also contained an incorrect example that recommended using this option to test an engine's controllers within the dummy application. That recommendation was incorrect and has since been corrected. Instead, you should override the `@routes` variable in the test case with `Foo::Engine.routes`. See the updated engines guide for details. (called from test_get_applicability_by_brand_action at /home/sdilshod/webapp/ps_base/apps/www/test/controllers/catalogs_controller_test.rb:627)
  DEPRECATION WARNING: You are trying to generate the URL for a named route called "catalogs" but no such route was found. In the future, this will result in an `ActionController::UrlGenerationError` exception. (called from test_get_applicability_by_brand_action at /home/sdilshod/webapp/ps_base/apps/www/test/controllers/catalogs_controller_test.rb:627)
  </code></pre>
  
  <p>Advise me please correct solution.</p>
  
  <p>I'll hope your help, thanks!</p>