diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c2c372b2..198120ee 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,6 +9,15 @@ Dummy::Application.initialize! +# Rails 8.0+ puts off drawing the routes until a request first needs them, so +# whichever example makes the suite's first request would draw them under its +# own stubs: `mount_ember_app` asks the application whether its deploy is +# mountable, which a stubbed deploy cannot answer. Draw them up front, as +# earlier versions of Rails do while initializing. +if Rails.application.respond_to?(:reload_routes_unless_loaded) + Rails.application.reload_routes_unless_loaded +end + Dir["spec/support/**/*.rb"].sort.each { |file| require "./#{file}" } RSpec.configure do |config|