The word "temptations" here is the Greek word perirasomos, it does not refer to enticements to sin... but to trials, persecution and afflictions from the world or Satan.
As believers, we must meet these adversities with joy, for they will develop patience in us. When we are under great pressure, our "faith-life, our Christian-life" is forced out into the open and it will show our true colors and what we truly believe.
Our faith can only reach full maturity when we are faced with difficulties and opposition. James calls these trials a "trying of your faith."
Trials are sometimes brought into a believer's life so that God can test our faith. Scripture nowhere teaches that troubles in life are always an indication that God is displeased with us. They can be a sign that He recognizes our firm commitment to Him.
The phrase in James 1:2 where it says, "count it all joy when ye fall into divers temptations" is a hard pill to swallow at times. And, it certainly does "work out our patience or our lack thereof," within our Christian walk.
Faith is not always easy, and we shouldn't try to get out of anything prematurely. As believers, we must let faith do its work in us so that we become mature and well-developed Christians, not imperfect or inadequate in any way.
Faith brings us into a right relationship with God and gives Him His opportunity to work in our daily lives. He wants us to understand that it is a "life of faith" we live as believers, not a life of emotional enjoyment of His blessings.
When we began our walk with God our faith was centered around a small amount of experience that had as much emotion as faith in it... and it was full of blind sweetness. Then God withdrew His conscious blessings to teach us to "walk by faith!" 2 Corinthians 5:7
My friends it is God we trust in, and it is "what our faith does not yet see" that keeps us going! We have the "hope of eternity," could there be any more joy than this???