mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make sure the test fails if the code chages
The test was passing before because it was not being testes correctly. Now we create a different engine that is loaded before the already exising and we make sure that the first call for isolate_namespace is what takes effect.
This commit is contained in:
parent
710377199d
commit
62d3d12149
1 changed files with 10 additions and 8 deletions
|
@ -882,15 +882,17 @@ YAML
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
|
||||||
@plugin.write "lib/new_lugin.rb", <<-RUBY
|
engine "loaded_first" do |plugin|
|
||||||
module AppTemplate
|
plugin.write "lib/loaded_first.rb", <<-RUBY
|
||||||
module NewPlugin
|
module AppTemplate
|
||||||
class Engine < ::Rails::Engine
|
module LoadedFirst
|
||||||
isolate_namespace(AppTemplate)
|
class Engine < ::Rails::Engine
|
||||||
|
isolate_namespace(AppTemplate)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
RUBY
|
||||||
RUBY
|
end
|
||||||
|
|
||||||
app_file "config/routes.rb", <<-RUBY
|
app_file "config/routes.rb", <<-RUBY
|
||||||
Rails.application.routes.draw do end
|
Rails.application.routes.draw do end
|
||||||
|
@ -898,7 +900,7 @@ YAML
|
||||||
|
|
||||||
boot_rails
|
boot_rails
|
||||||
|
|
||||||
assert_equal AppTemplate::Engine, AppTemplate.railtie_namespace
|
assert_equal AppTemplate::LoadedFirst::Engine, AppTemplate.railtie_namespace
|
||||||
end
|
end
|
||||||
|
|
||||||
test "properly reload routes" do
|
test "properly reload routes" do
|
||||||
|
|
Loading…
Reference in a new issue