aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2015-11-04 11:20:19 -0500
committerYves Senn <yves.senn@gmail.com>2015-11-04 11:20:19 -0500
commit3f53df74d716c9db6b94a0ead9b8d2b526b6d8ee (patch)
tree4fc0f2649069fac55e339501d9a79aa8f1cc3b85
parente38aa9d7464c6cfd851dd4436b67a858e4e899f3 (diff)
parent91f5adf03aaf5347c694d901a81c25ee40525497 (diff)
downloadrails-3f53df74d716c9db6b94a0ead9b8d2b526b6d8ee.tar.gz
rails-3f53df74d716c9db6b94a0ead9b8d2b526b6d8ee.tar.bz2
rails-3f53df74d716c9db6b94a0ead9b8d2b526b6d8ee.zip
Merge pull request #22174 from metaskills/defsetup
Update docs/comments to use setup/teardown blocks vs. methods. [ci skip]
-rw-r--r--activesupport/lib/active_support/log_subscriber/test_helper.rb3
-rw-r--r--guides/source/active_model_basics.md6
-rw-r--r--guides/source/testing.md4
3 files changed, 6 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/log_subscriber/test_helper.rb b/activesupport/lib/active_support/log_subscriber/test_helper.rb
index cbc20c103d..588ed67c81 100644
--- a/activesupport/lib/active_support/log_subscriber/test_helper.rb
+++ b/activesupport/lib/active_support/log_subscriber/test_helper.rb
@@ -10,8 +10,7 @@ module ActiveSupport
# class SyncLogSubscriberTest < ActiveSupport::TestCase
# include ActiveSupport::LogSubscriber::TestHelper
#
- # def setup
- # super
+ # setup do
# ActiveRecord::LogSubscriber.attach_to(:active_record)
# end
#
diff --git a/guides/source/active_model_basics.md b/guides/source/active_model_basics.md
index fe2501bd87..8f8256c983 100644
--- a/guides/source/active_model_basics.md
+++ b/guides/source/active_model_basics.md
@@ -8,10 +8,10 @@ classes. Active Model allows for Action Pack helpers to interact with
plain Ruby objects. Active Model also helps build custom ORMs for use
outside of the Rails framework.
-After reading this guide, you will know:
+After reading this guide, you will know:
* How an Active Record model behaves.
-* How Callbacks and validations work.
+* How Callbacks and validations work.
* How serializers work.
* The Rails internationalization (i18n) framework.
@@ -428,7 +428,7 @@ the Active Model API.
class PersonTest < ActiveSupport::TestCase
include ActiveModel::Lint::Tests
- def setup
+ setup do
@model = Person.new
end
end
diff --git a/guides/source/testing.md b/guides/source/testing.md
index a07772036b..2f941a8280 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -908,12 +908,12 @@ require 'test_helper'
class ArticlesControllerTest < ActionController::TestCase
# called before every single test
- def setup
+ setup do
@article = articles(:one)
end
# called after every single test
- def teardown
+ teardown do
# when controller is using cache it may be a good idea to reset it afterwards
Rails.cache.clear
end