On Wednesday, 28 July 2021 at 21:19:55 UTC+1 josep...@gmail.com wrote:
> The plot thickens. I pulled down Rails from Github so I can try poking > around the code there and it appears that this problem goes away in Rails > 7.0! Maybe a diff between head and the 6.1 branch will show something ... > > FYI, this was the commit that fixed it in Rails 7 - https://github.com/rails/rails/commit/14d4edd7c3b06e82e1fcef54fa0b4453315c35fd - and I have found that I can add: ActiveSupport::Dependencies::Reference.clear! before the `stub_const` lines to clear all the cached references and the tests now pass when run together. I will need to have something to skip that when running the tests with Rails 7+ but it looks as though this is the solution. Regards, Joe -- 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 rspec+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/cf78d8b3-c0e8-4346-bfbb-6d6e3dfa580en%40googlegroups.com.