How can I get the rails server to use the same database cucumber uses during the test?
The cucumber test first makes an entry in the database and submits the form to the second server. This second server does some processing in the background and then ends up in the first application (where the test is running) with some data that the cucumber test needs to know about.
I've tried starting the main server through script/server
and script/server -e test
during cucumber validation, but I can't seem to get the server to use the same database as the cucumber when it does its defining step. That is, when the second server pushes some data to the controller on the master server, the master server is unaware of any entries that the cucumber has made in the database. How can I get cucumber and main server to use the same database?
a source to share
You bang the solution over the head in your comment (you have no karma to answer). Tests are executed inside a transaction that is returned at the end. In this way, the front-end server is insulated from the consequences of any queries that cucumber makes to the database. Disabling transactional lights is the way to go, but I don't know why it doesn't work.
Other solutions are to: a) rebuild your code so you don't need a shared database (which might cause problems elsewhere), or b) so that your Cucumber test hits the second server database (via an HTTP request? ).
a source to share