Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Scrubbing controller instance variables in ActionController::TestCase
#
# Allow garbage collection of controller data after test completion
# Add to test_helper.rb
#
class ActionController::TestCase
def teardown
@controller.instance_variables.each do |ivar|
@controller.instance_variable_set(ivar,nil)
end
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment