Fixed API rule error message tests

Previously we were not checking that the error messages
contained the appropriate text.

Closes-bug: 1379602
Change-Id: Ie29f1bc2f56d60eeff4b92efeae5e32e3705e41a