I don't think you need to take a test to get promoted specifically to commander.
If you are a 'blue shirt' (i.e. a science officer, counselor or doctor), I think that's the only time this special test is required. A command or operations officer who is a LCDR, and wishes to be promoted, probably does not have to take the test. In the episode it is implied that the test is only for blue-uniformed officers, who are outside the chain of command.