Hi Sean I can’t offer any specific advise because it’s been a while since I had to do this, but I can say that rspec shouldn’t be the factor blocking you here, rspec-rails is a thin wrapper over rails own test helpers, so any generic rails / multiple database guide should offer help.
I had a look at the article and it looks to me (as the RSpec maintainer and a former DatabaseCleaner contributor) like it should work, if you want to provide more details maybe people can offer more specific feedback? If it turns out there is something you can’t access from Rails 6 within RSpec I’m keen to help there. Cheers Jon Rowe --------------------------- [email protected] jonrowe.co.uk On 23 June 2020 at 17:28, Sean Smith wrote: > I'm using Rails 6.0 for API purposes only, we have a 3 DB setup with multiple > databases typically being accessed during a single request spec. We've issues > using transactions to clean the database with multiple databases. I've tried > setting up something similar to this: > http://joshfrankel.me/blog/configure-rspec-for-multiple-databases-with-database-cleaner-support/ > and tried every variation I could think of, but still have problems. Is > there any guide for setting up rspec + Rails 6.0 + multiple databases? I was > able to get a working solution using DatabaseCleaner + truncation as a > strategy but as our suite has grown I'd love to get back the performance > benefit of transactions. I played around more last night and still had > similar issues. I can describe what seems to be happening in more detail if > needed, but as of yet I haven't found any good resources on the best way to > achieve this setup. > > > > > -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/dejalu-217-02bcc315-90b8-4b74-a9cc-99cc6e5795e5%40jonrowe.co.uk.
