tests for alert email changing plus fix to make it work

Where the setting of the email address for the THEUSER object was
happening meant that the alert updating code was not being run so assign
->email once the update has been succesful. This also makes more sense
as it means the email has been updated rather than assuming it will be.