jeudi 27 octobre 2016

Share testing data between rails application

In our company project, we have 2 Rails projects: A and B share the same database but different models. My boss doesn't allow me extract the models to a gem / rails engine for both projects because I'm new member and it takes many risks for our production. So I have to keep it as currently. I've researched a lot of things but still doesn't have solution at the moment. Let's me summarize:

Project A usually used to create and save data to database so that the models in A always up-to-date. Project B is used to load data so that project B doesn't have all the models as A and some models in B have lack associations. My mission is adding tests for project B. This is my solution:

First of all, I share one database test for both projects.

Secondly, in project A, I setup Factory Girl to create test data.

So the question is that from project B, how can I call or trigger project A to run the A's Factory Girl in order to create test data so that project B could load that data and verify it ?

Aucun commentaire:

Enregistrer un commentaire