I want to spec my controllers before_filter with rspec.
I thought to use ActionController::Testing::ClassMethods#before_filters for it.
I got these results in my rails c:
2.0.0p353 :006 > ActionController::Base.singleton_class.send :include, ActionController::Testing::ClassMethods
2.0.0p353 :003 > EquipmentController.before_filters
=> [:process_action, :process_action]
But in reality this is the filter on my action:
class EquipmentController < ApplicationController
before_filter :authenticate_user!
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…