aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-04-28 14:27:08 -0700
committerPiotr Sarnacki <drogus@gmail.com>2012-04-28 14:38:12 -0700
commit5a2fdaa27796502daf0fb2314e599b76049296d4 (patch)
tree7d9598ee7eb3a389a70f03e1c249ba7377eb2627 /railties/test
parentd9239fd4c9e35f93e6594b1d95af85e772fc2b26 (diff)
downloadrails-5a2fdaa27796502daf0fb2314e599b76049296d4.tar.gz
rails-5a2fdaa27796502daf0fb2314e599b76049296d4.tar.bz2
rails-5a2fdaa27796502daf0fb2314e599b76049296d4.zip
Fix Engine#routes to not call draw_paths multiple times
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/unit/engine_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/test/unit/engine_test.rb b/railties/test/unit/engine_test.rb
index 977f46ecea..02d40d97f6 100644
--- a/railties/test/unit/engine_test.rb
+++ b/railties/test/unit/engine_test.rb
@@ -12,5 +12,15 @@ module Unit
assert !engine.routes?
end
+
+ it "does not add more paths to routes on each call" do
+ engine = Class.new(Rails::Engine)
+
+ engine.routes
+ length = engine.routes.draw_paths.length
+
+ engine.routes
+ assert_equal length, engine.routes.draw_paths.length
+ end
end
end