Running specification for rails engine from its parent application

I have an rspec package for the parent application, as well as some specifications for connected engines. I want to run them with a single command. Is there a way to include my gem paths in the rspec boot path? Or should I write a rake task for this?

+7
source share
1 answer

I think this is an interesting question, but I believe that Rails Engines should be considered as an independent code base and therefore should not be tested in its parent application. The effect is that you treat the Rails Engine in your parent application the same way you treat other gems (EG, devise, which is actually the Rails Engine).

But let's say you have the functionality of the parent application, which depends on the function of the Rails Engine. In this case, I would write a test to show that my parent application functionality works with the Rails Engine. I would not write a test to ensure that the Rails Engine works as intended because these tests belong to the Rails Engine code base and not to the parent application.

I understand that this methodology is not well applied in real life scenarios when you are simultaneously developing a parent application and Rails Engine.

+2
source

All Articles