There is no specific test to diagnose IBS. It is mainly a clinical diagnosis after exclusion of certain 'red flag' indicators. There are certain diagnostic criteria that will help your doctor make a diagnosis.
There is no 'magic pill' to cure irritable bowel syndrome but there are certain things you can do to make yourself feel better. First thing would be to have a better understanding of this problem and then learning what you can do to help yourself. We do know that there are certain food triggers that can bring about the symptoms, so do have an awareness of the food you take, have a food diary and take note of when your symptoms occur. With that you can slowly avoid the 'triggering' foods. Do not eliminate all your foods such that you do not get enough nutrients. Stress too can also trigger off symptoms, so relaxation techniques can keep symptoms at bay.
Depending on whether you are bothered by pain from spasms, or diarrhoea or constipation, your doctor can prescribe some medication for you to help decrease the symptoms.