When testing this action, I want to test that the correct generated_key is being sent to Redis to initiate a lock.

I set up an expect for the Redis::Lock but that returns false always presumably because the request to create is sent mid request and not at the end of it.

expect(Redis::Lock).to receive(:create).once

Since the lock is cleared at the end of the method call, I cannot check for the key in redis as a test.

This answer recommends setting up a fake class that matches the structure of Lockable to emulate the same behaviour but how do I write a test for it? The method we have does not return any value to verify.