Saturday, July 2, 2011

"Missing template" error with RSpec... Solved

If you ever get an error like...
Failure/Error: post :destroy, :id => organization.id
     ActionView::MissingTemplate:
       Missing template superadmin/organizations/destroy, application/destroy with {:handlers=>[:erb, :builder], :formats=>[:html], :locale=>[:en, :en]}. Searched in:
         * "#"
...when you run a spec test for a controller, and your routes are definitely fine and there shouldn't be a template for the action, you just need to specify a redirect_to or render.

2 comments:

  1. Cheers buddy, this had me pretty confused.

    ReplyDelete
  2. Thank God I found this. It was driving me insane! Thank you!

    ReplyDelete

Please be considerate in what you say.