mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use def setup
instead of setup do
`setup do` creates unnecessary allocations of proc objects in callbacks. This prevents that from happening and results in faster code.
This commit is contained in:
parent
9c655f1275
commit
044f9ab7a4
1 changed files with 4 additions and 2 deletions
|
@ -32,13 +32,15 @@ if defined?(ActiveRecord::Base)
|
|||
end
|
||||
|
||||
class ActionController::TestCase
|
||||
setup do
|
||||
def setup
|
||||
@routes = Rails.application.routes
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
class ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
def setup
|
||||
@routes = Rails.application.routes
|
||||
super
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue