How to reload controller cache class in guard-spork using rspec

I want to test my conletler with spor with rspec. When I change my controller class. rpsec didn't reload my controller code. I think the problem is with reloading or class cache. After searching for some article including put ActiveSupport::Dependencies.clear

to spec_helper

each_run

and prefork

. But it doesn't work.

+3


source to share


1 answer


Try the following:



Spork.each_run do
  # reload all the controllers
  Dir["#{Rails.root}/app/controllers/**/*.rb"].each do |controller|
    load controller
  end
end

      

0


source







All Articles