No route matches {:controller=>"submissions"}
<p>I get this error when I'm running a test that simply does <code>get :index</code>. Here is the test code:</p>

<pre><code>class SubmissionsControllerTest &lt; ActionController::TestCase
  setup do
    @submission = submissions(:one)
  end

  test "should get index" do
    get :index
    assert_response :redirect
    # assert_not_nil assigns(:submissions)
  end
</code></pre>

<p>I have a route set up for this controller though in my routes.rb file:</p>

<pre><code>resources :courses do
    resources :assignments do
      get 'export', :controller =&gt; 'assignments', :action =&gt; 'export'
      resources :memberships
      resources :submissions do
        resources :evaluations do
          delete 'destroy', controller: 'reviews', action: 'destroy'
        end
      end

      resources :questions do
        resources :responses
        resources :scales
      end

      resources :reviews do
        get :assign_reviews, :on =&gt; :collection
        post :edit_review, :on =&gt; :collection
      end

    end
  end
</code></pre>

<p>Also, this is what I get for submissions routes when I run rake routes:</p>

<pre><code>course_assignment_submissions GET    /courses/:course_id/assignments/:assignment_id/submissions(.:format)  submissions#index
POST /courses/:course_id/assignments/:assignment_id/submissions(.:format)  submissions#create
new_course_assignment_submission GET    /courses/:course_id/assignments/:assignment_id/submissions/new(.:format)  submissions#new
edit_course_assignment_submission GET    /courses/:course_id/assignments/:assignment_id/submissions/:id/edit(.:format)  submissions#edit
course_assignment_submission GET    /courses/:course_id/assignments/:assignment_id/submissions/:id(.:format)  submissions#show
PUT /courses/:course_id/assignments/:assignment_id/submissions/:id(.:format)  submissions#update
DELETE /courses/:course_id/assignments/:assignment_id/submissions/:id(.:format)  submissions#destroy
</code></pre>

<p>And here is my code for the index action:</p>

<pre><code>def index
    if !current_user.instructor?(@course)
      raise CanCan::AccessDenied.new("Not authorized!")
    end

    registrations =  @course.registrations
    @students = registrations.select{|r| !r.user.pseudo or @assignment.memberships.any?{|m| m.pseudo_user_id == r.user_id }  }.map{|r| r.user }
    respond_to do |format|
      format.html # index.html.erb
      format.json { render json: @students }
    end
  end
</code></pre>

<p>Does anyone know where this error could be coming from then?</p>