diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-08-04 16:50:21 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2017-08-04 16:50:21 -0400 |
commit | 62d3d12149b8b17d03786a372d5cfe59c84a29b5 (patch) | |
tree | 3607827bc20872b6b6a8dd10f7ea62c0cddc206c /railties/test | |
parent | 710377199de07e2be4df01ecbdc9067a3aa11861 (diff) | |
download | rails-62d3d12149b8b17d03786a372d5cfe59c84a29b5.tar.gz rails-62d3d12149b8b17d03786a372d5cfe59c84a29b5.tar.bz2 rails-62d3d12149b8b17d03786a372d5cfe59c84a29b5.zip |
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.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/railties/engine_test.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb index 247c78db27..145c2ec7b6 100644 --- a/railties/test/railties/engine_test.rb +++ b/railties/test/railties/engine_test.rb @@ -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 |