From ef7274be877dc89d232b104e93b5022b56360820 Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Sat, 3 Jan 2015 23:45:50 +0100 Subject: Better example of `teardown` method in test guide rails/rails#18305, thanks for @dhh suggestion --- guides/source/testing.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/guides/source/testing.md b/guides/source/testing.md index 065ca71d48..a685d95c19 100644 --- a/guides/source/testing.md +++ b/guides/source/testing.md @@ -753,10 +753,8 @@ class ArticlesControllerTest < ActionController::TestCase # called after every single test def teardown - # as we are re-initializing @article before every test - # setting it to nil here is not essential but I hope - # you understand how you can use the teardown method - @article = nil + # when controller is using cache it may be a good idea to reset it afterwards + Rails.cache.clear end test "should show article" do -- cgit v1.2.3