Rspec and Redis Testing Setup

Nauman Tariq
2 min readSep 8, 2021

Using the VCR, Sidekiq/testing, FactoryGirl, and DatabaseCleaner, etc gems can help get data into the right state for your Rails tests when they are using data from your test database environment. With Redis, how do you do the same thing? Certainly, we don’t want this extra layer to be installed.

We’ve started using Redis for caching API calls, especially for external calls, where we don’t need fresh data for at…

--

--