[rspec-users] Rspec with Nested Resources

Arnaldo Junior arnaldo.junior at aedu.com
Thu Apr 12 17:32:27 UTC 2012


Hi, I have problems to implement the tests with RSpec with nested
routes in views, as I implement these tests?
Always gives error that it can not find the routes.

#config/routes.rb

resources :controller1 do
    resources :controller2
end


My test view

#spec/views/controller2/index.html.erb_spec.rb

require 'spec_helper'

describe "controller2/index" do

  it "renders a list of planos" do
    render
  end
end


And return this error

Failure/Error: render
     ActionView::Template::Error:
       No route matches {:controller=>"controller2"}

Can anybody help-me?
Thanks.


More information about the rspec-users mailing list