I wonder how you would solve this problem?
You want to reorganize the following code
class AController < ActionController::Base
before_filter :the_method
protected
def the_method
end
end
at
class AController < ActionController::Base
include TheModule
end
but since you are a BDD enthusiast, you need to write a spec first
describe TheModule do
context "when included" do
it "adds #the_method as a before_filter" do
end
end
end
In other words, the question is: How to write a specification that checks if TheModel # the_method is added as before_filter when it is included in the class (presumably the controller class).
source
share