diff --git a/spec/support/pageflow/dummy/app.rb b/spec/support/pageflow/dummy/app.rb index b52ce1e5f5..8f752ce479 100644 --- a/spec/support/pageflow/dummy/app.rb +++ b/spec/support/pageflow/dummy/app.rb @@ -18,7 +18,6 @@ def generate end require(File.join(ENV['RAILS_ROOT'], 'config', 'environment')) - require('pageflow/dummy/config/pageflow') end def directory diff --git a/spec/support/pageflow/dummy/config/pageflow.rb b/spec/support/pageflow/dummy/config/pageflow.rb index 256d25b32f..c1a4d7f057 100644 --- a/spec/support/pageflow/dummy/config/pageflow.rb +++ b/spec/support/pageflow/dummy/config/pageflow.rb @@ -14,6 +14,3 @@ } end end - -# Reconstruct current config to ensure config block above is used -Pageflow.configure! diff --git a/spec/support/pageflow/dummy/rails_template.rb b/spec/support/pageflow/dummy/rails_template.rb index dbf6847607..00d02dc9d1 100644 --- a/spec/support/pageflow/dummy/rails_template.rb +++ b/spec/support/pageflow/dummy/rails_template.rb @@ -69,6 +69,12 @@ def source_paths ActiveAdmin.application.load_paths.unshift(Dir[Rails.root.join('app/admin')].first)\n END +# Adapt default configuration + +inject_into_file('config/initializers/pageflow.rb', + "require 'pageflow/dummy/config/pageflow'\n", + after: "Pageflow.finalize!\n") + # Add required files for test theme copy_file('test_theme.scss',