There's probably no official test, but maybe it's based on the observations of the village leaders (in a similar format to the chuunin exam). i.e. the higher ranks will observe the nins and decide when they are worthy.

The promotion may be based on fighting ability, number of jutsus learnt, leadership, natural talent, and/or how many missions have been completed.