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
@ -882,15 +882,17 @@ class Engine < ::Rails::Engine
|
|||||||
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 @@ class Engine < ::Rails::Engine
|
|||||||
|
|
||||||
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 New Issue
Block a user