First thing first... get an extension on your registration. The DMV will give you temporary tags to drive legally with. Next you can apply for CAP. If you are low income you will be eligible. Check the CAP requirements. As far as the diagnosis... apparently the replaced gas cap didn't do the trick. You're going to need a smog check diagnosis. Since you've failed the smog check, if you get approved for CAP, they will conduct the diagnosis for free (actually as a part of the $500.00 they pay for repairs). If you don't get accepted, the diagnosis is your first step. The average cost for a smog check failure diagnosis is two hours of labor (around $150.00). Shop around you might find a smog station with lower labor rates.