Skip to content


View specs fail with "method `protect_against_forgery?' not defined in #<Module:0x10a678468>" #386

cgriego opened this Issue · 3 comments

2 participants


I'm attempting to upgrade a Rails 3.0 app to 3.1 edge but all of my view specs fail within action_view/test_case.

Failure/Error: Unable to find matching line from backtrace
  method `protect_against_forgery?' not defined in #<Module:0x10a678468>
# ruby/1.8/bundler/gems/rails-92661b0c501a/actionpack/lib/action_view/test_case.rb:132:in `remove_method'
# ruby/1.8/bundler/gems/rails-92661b0c501a/actionpack/lib/action_view/test_case.rb:132:in `say_no_to_protect_against_forgery!'
# ruby/1.8/bundler/gems/rails-92661b0c501a/actionpack/lib/action_view/test_case.rb:131:in `module_eval'
# ruby/1.8/bundler/gems/rails-92661b0c501a/actionpack/lib/action_view/test_case.rb:131:in `say_no_to_protect_against_forgery!'
# ruby/1.8/bundler/gems/rails-92661b0c501a/actionpack/lib/action_view/test_case.rb:100:in `setup_with_controller'
# ruby/1.8/gems/rspec-rails-2.5.0/lib/rspec/rails/adapters.rb:11:in `send'
# ruby/1.8/gems/rspec-rails-2.5.0/lib/rspec/rails/adapters.rb:11:in `setup'
Ruby on Rails member

Can you post a failing application on github? I will look into it asap.

Ruby on Rails member

Please check if it is fixed on master.


Fixed! Thanks José.

@cgriego cgriego closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.