From 5a2fdaa27796502daf0fb2314e599b76049296d4 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Sat, 28 Apr 2012 14:27:08 -0700 Subject: Fix Engine#routes to not call draw_paths multiple times --- railties/test/unit/engine_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'railties/test') 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 -- cgit v1.2.3