[rspec-users] RSpec 2: undefined method `controller_name' for :Class (NoMethodError)

Kristian Mandrup kmandrup at gmail.com
Thu Jun 10 11:49:29 EDT 2010


describe ApplicationController, "handling AccessDenied exceptions" do

  class FooController < ApplicationController
    def index
      raise AccessDenied
    end
  end
  controller_name 'foo' # OUCH!!!

  it "redirects to the /401.html (access denied) page" do
    get :index
    response.should redirect_to('/401.html')
  end

end
--
So how do I set the controller name using RSpec 2/Rails 3?


More information about the rspec-users mailing list