Usul al-Kafi
Book 3: The Book of Excellence of Knowledge

Chapter 27
Tests and trials of mankind

269. 1. Imam Jafar as-Sadiq (p): With each and every scarcity and abundance (adversity and affluence) is associated Divine Will, Judgment and test.
Translator’s note: This saying of the Imam (p) may briefly be explained as follows: God never compels anyone to commit sins and indiscretions, nor does He like those who commit sins and indiscretions but as He has bestowed free will to mankind to certain defined limits, men commit sins for which they are solely responsible.