Closed improbablistic closed 1 year ago
Transactions are per-process. I don't know how you could have a system test process (e.g. Capybara driving a web browser) running a transaction in a controller action which is visible to a separate FWR process. You could schedule the job to run in one second and have the controller transaction commit so the job can see the transactional data.
Thanks for the feedback, my current approach is to set up a custom rails environment where integration tests will not use transactional fixture. This way, both worker process and rails server will update the same test database.
Not the most elegant solution, but I suppose it will work for the time being.
I would like to get advice on how to perform integration test (more detail on what I mean below) that involves Rails and Faktory.
Set Up
I have a project that boils down to the following:
Test Case
I am hoping to create integration tests that will run a the mentioned live and make use of the test API offered by rails. In particular, I am wondering if it is possible to set up test instance of Faktory worker that accesses Minitest DB Transaction used in system test?
Thank you.