Why consider_all_requests_local fails with rspec config

后端 未结 4 1587
名媛妹妹
名媛妹妹 2021-01-04 12:00

rspec-rails (2.7.0) rails (3.0.10) post: Rails 3.1 Error Catching is irrelevant for me.

Code:

class ApplicationController < ActionController::Base         


        
4条回答
  •  爱一瞬间的悲伤
    2021-01-04 12:13

    The logic block is defined on class level, which gets evaluated during the class load time. This is why it will not go to 'else' even if you manually set it to false at run time.

    I am also curious to know what's the best way to test this. My only clue is somehow reload or re eval ActionController, similar to reload! method in rails console.

提交回复
热议问题