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:
Rafael Mendonça França 2017-08-04 16:50:21 -04:00
parent 710377199d
commit 62d3d12149

@ -882,15 +882,17 @@ class Engine < ::Rails::Engine
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 @@ class Engine < ::Rails::Engine
boot_rails
assert_equal AppTemplate::Engine, AppTemplate.railtie_namespace
assert_equal AppTemplate::LoadedFirst::Engine, AppTemplate.railtie_namespace
end
test "properly reload routes" do