How can we depend more on our main rails app instead of the dummy app in engine specs?

TL;DR We’re copying bits of code from places like /app/models/model.rb to the corresponding /components/component_name/spec/dummy/app/models/model.rb and it’s a nightmare. How can we depend on monolith code inside of the engine’s dummy app?

We have a somewhat large rails application of around 150k LOC and growing. We’ve extracted some teams into their own engine within /components on the main app (same repository). The idea is that each component will eventually be a microservice that depends on client libraries maintained by the monolith team.

At the moment, our engine’s only real contracts are with bits of code that we copy over from the monolith to components/component_name/spec/dummy/ for specs. Everything else happen at runtime when the engine is mounted on the monolith. This means that if something changes in the monolith that we depend on, our integration would break at runtime but pass tests.

Is there a good way to depend on code as it exists in the main app instead of having to stub functionality in the engine’s dummy app?