我刚刚升级到了Rails 5,一切都很顺利,但是由于某种原因,在skip_before_action
之后调用的方法不允许rspec运行,并显示以下错误信息:
在process_action回调函数之前,redirect_heroku_user未被定义(ArgumentError)。
这非常奇怪,因为在Rails 4上它完全正常。以下是我的代码:
# application_controller.rb
def redirect_heroku_user
redirect_to root_path if heroku_user?
end
# some_controller.rb
skip_before_action :redirect_heroku_user, only: :edit