Hisnul Muslim 185

By one fasting when presented with food and does not break his fast

إذا دُعي أحدكم فليجب ، فإن كان صائماً فليصل وإن كان مفطراً فليطعم, ومعنى فليصل أي فليدع

When you are invited (to eat) then reply to the invitation. If you are fasting then invoke Allah's blessings (on your host), and if you are not fasting then eat.