I use Ecto.UUID.generateto create a random token in the user model.
In my ExUnit test , I want to check the controller that calls the creation route, however, since the token is always random, I cannot deterministically check the result.
Ideally, I want to be able to stub Ecto.UUID.generatein my test so that it always generates the same UUID so that I can verify the answer correctly.
Thank:)
source
share