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
|
||||
RUBY
|
||||
|
||||
@plugin.write "lib/new_lugin.rb", <<-RUBY
|
||||
module AppTemplate
|
||||
module NewPlugin
|
||||
class Engine < ::Rails::Engine
|
||||
isolate_namespace(AppTemplate)
|
||||
engine "loaded_first" do |plugin|
|
||||
plugin.write "lib/loaded_first.rb", <<-RUBY
|
||||
module AppTemplate
|
||||
module LoadedFirst
|
||||
class Engine < ::Rails::Engine
|
||||
isolate_namespace(AppTemplate)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
RUBY
|
||||
RUBY
|
||||
end
|
||||
|
||||
app_file "config/routes.rb", <<-RUBY
|
||||
Rails.application.routes.draw do end
|
||||
|
@ -898,7 +900,7 @@ YAML
|
|||
|
||||
boot_rails
|
||||
|
||||
assert_equal AppTemplate::Engine, AppTemplate.railtie_namespace
|
||||
assert_equal AppTemplate::LoadedFirst::Engine, AppTemplate.railtie_namespace
|
||||
end
|
||||
|
||||
test "properly reload routes" do
|
||||
|
|
Loading…
Reference in a new issue