mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Don't create new directory for tests
This commit is contained in:
parent
5a2fdaa277
commit
1823d53d7b
2 changed files with 24 additions and 26 deletions
24
railties/test/engine_test.rb
Normal file
24
railties/test/engine_test.rb
Normal file
|
@ -0,0 +1,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
|
|
@ -1,26 +0,0 @@
|
|||
require 'abstract_unit'
|
||||
|
||||
module 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
|
||||
end
|
Loading…
Reference in a new issue