From earliest times trial and temptation has been seen not as failure, but as opportunities for people to show their obedience to God. To successfully endure the trial or temptation made one acceptable to God. Jesus is the prime example of this. The New Testament is not embarrassed at all that he was tested or tempted. (See Mark 1:2-13; Heb 4:15) In fact, it is absolutely critical to the whole gospel that he was. Jesus was tempted – by the evil one, by his opponents, and by his disciples even (e.g. see Mark 8:31-33) – and was obedient, even to death on the cross. (Phil 2:8) The cross was the climax of this testing, and the most severe form of it. (Mark 14:34-36) And it is because Jesus was faithful, even in the face of this prolonged and severe testing, that we are saved. And because he endured temptation and was obedient, we too can do it. (This is the point of the Book of Hebrews, see Heb 2:10, 14-18; 12:1-11) Life is full of temptations, with the Spirit of Christ we are not defeated but will emerge victorious through and with him.
Which is just my opening statement really, so more on this later.