Running spec for a rails engine from its parent app

百般思念 提交于 2019-12-04 06:13:58

I think this is an interesting question, but my opinion is that Rails Engines should be treated as an independent code base and therefore not tested in your parent app. The effect is that you'd treat a Rails Engine in your parent app much like you treat other gems (EG, devise, which is actually a Rails Engine).

But let's say you have parent app functionality that relies on a Rails Engine feature. In that case, I would write a test to show that my parent app's functionality works in conjunction with the Rails Engine. I would not write the test ensuring that the Rails Engine works as it is supposed to because those tests belong in the Rails Engine code base, not the parent app.

I realize this methodology does not apply perfectly in real work scenarios when you are simultaneously developing the parent app and the Rails Engine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!