The cucumber test first makes an entry in the database and posts a form to a second server. This second server does some processing in background and then hits the first app (where the test is being run) with some data that the cucumber test needs to know about.
I’ve tried running the main server via script/server and script/server -e test while the cucumber test is running, but I can’t seem to force the server to use the same database that cucumber is using when it runs its step definitions. That is, when the second server pushes some data to a controller in the main server, the main server doesn’t know about any entries that cucumber has made in the database. How can I get cucumber and the main server to use the same database?
You hit the solution on the head in your comment (don’t have the karma to reply). The tests are run within a transaction, which is rolled back at the end. So, the external server is isolated from the effects of any queries Cucumber performs on the database. Disabling transactional fixtures is the way to go, but I don’t know why it’s not working.
Other solutions would be to a) rearchitect your code so you don’t need a common database (that’s bound to cause problems elsewhere), or b) have your Cucumber test reach into a the second server’s database (via an HTTP request?).