Solved it. I needed to use ```DatabaseCleaner.strategy = :truncation`` instead of :transaction
In the past I've been running Cucumber tests inside rack with the browser being controlled locally so that records created are visible to the browser.
But I can't do that when running inside a docker container. So I have to use a dockerised selenium which runs remotely. Therefore the default database cleaner strategy, :transaction won't work because records would be created inside a transaction, are are therefore invisible to remote selenium.
Once I switched to :truncation it all worked.