title: ActionController::UrlGenerationError when trying to test namespaced controllers
body: <p>I'm trying to write a controller specs for one of my controller action defined under <code>Front</code> namespace (and living in <code>Front</code> engine mounted in root rails app). I've been following this thing to acheive that: <a href="https://www.relishapp.com/rspec/rspec-rails/docs/controller-specs/engine-routes-for-controllers" rel="nofollow">https://www.relishapp.com/rspec/rspec-rails/docs/controller-specs/engine-routes-for-controllers</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code># config/routes/rb
  Rails.application.routes.draw do
    mount Front::Engine =&gt; '/', as: 'front'
  end
  </code></pre>
  
  <hr>
  
  <pre><code># modules/front/config/routes.rb
  Front::Engine.routes.draw do
    resources :items
  end
  </code></pre>
  
  <hr>
  
  <pre><code># modules/front/app/controllers/front/items_controller.rb
  class Front::ItemsController &lt; Front::ApplicationController
    def index
      # ...
    end
  end
  </code></pre>
  
  <hr>
  
  <pre><code># spec/controllers/front/items_controller_spec.rb
  require 'rails_helper'
  
  RSpec.describe Front::ItemsController, type: :controller do
    routes { Front::Engine.routes }
  
    describe "GET index" do
      it "assings @items" do
        item = FactoryGirl.create(:item)
        get :index
        expect(assigns(:items)).to eq([item])
      end
    end
  end
  </code></pre>
  
  <hr>
  
  <p>Running above spec gives me:</p>
  
  <pre><code>Front::ItemsController
    GET index
      assings @items (FAILED - 1)
  
  Failures:
  
    1) Front::ItemsController GET index assings @items
       Failure/Error: get :index
  
       ActionController::UrlGenerationError:
         No route matches {:action=&gt;"index", :controller=&gt;"front/items"}
  </code></pre>
  
  <p>It all works fine outside of specs, i can totally access that endpoint. Any ideas what's wrong in here? Thanks in advance.</p>
  
  <ul>
  <li>ruby 2.3.1</li>
  <li>rspec 3.4.4</li>
  <li>rails 4.2.1</li>
  </ul>