Since a test double is meant to stand in for a real object, it needs to act like one. You need to be able to configure how it responds to the code calling it.
When you allow or expect a message on a test double without specifying how it responds, RSpec provides a simple implementation that just returns nil. Your test doubles will often need to do something more interesting: return a given value, raise an error, yield to a block, or throw a symbol. RSpec provides ways for your doubles to do each of these:
|||allow(double).to receive( ...|