Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ActiveSupport::TestCase
- def setup
- clear_all_collections
- end
- def clear_all_collections
- # ruby 1.9 compatability
- Dir[File.join(Rails.root, 'app/models/**/*.rb')].each do |model_path|
- klass = File.basename(model_path, '.rb').classify.constantize
- klass.collection.remove if klass.respond_to?(:collection)
- end
- end
- end
Add Comment
Please, Sign In to add comment