blob: 68406dce4c0195f2997f00bbd0204a6406337ff4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
require 'abstract_unit'
class EngineTest < ActiveSupport::TestCase
it "reports routes as available only if they're actually present" do
engine = Class.new(Rails::Engine) do
def initialize(*args)
@routes = nil
super
end
end
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
|