We use this in a Controller method to ensure concurrent requests are handled correctly.
redis_lock(<generated_key>, timeout:15)do# perform_operationend
render json:<data>, status::ok
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.
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.