lib/decidim/dev/engine.rb in decidim-dev-0.28.4 vs lib/decidim/dev/engine.rb in decidim-dev-0.29.0.rc1

- old
+ new

@@ -1,7 +1,9 @@ # frozen_string_literal: true +require "decidim/dev/needs_development_tools" + module Decidim module Dev # Decidim's development Rails Engine. class Engine < ::Rails::Engine isolate_namespace Decidim::Dev @@ -23,9 +25,18 @@ ActiveSupport.on_load(:action_controller) { include Decidim::Dev::NeedsDevelopmentTools } if Rails.env.development? || ENV.fetch("DECIDIM_DEV_ENGINE", nil) end initializer "decidim_dev.webpacker.assets_path" do Decidim.register_assets_path File.expand_path("app/packs", root) + end + + initializer "decidim_dev.middleware.test_map_server" do |app| + next unless Rails.env.test? + + require "decidim/dev/test/map_server" + + # Add the test map server as the first middleware in the stack + app.config.middleware.insert_before 0, Decidim::Dev::Test::MapServer end initializer "decidim_dev.moderation_content" do config.to_prepare do ActiveSupport::Notifications.subscribe("decidim.admin.block_user:after") do |_event_name, data|