This shared example was only used by this spec so having it in a
separate file provided no benefit, at the cost of clarity. This also
reduces the three `it` blocks into a single test with
`aggregate_failures`.
This would fix long standing failures running tests on
my development machine, which set `Gitlab.config.gitlab.host`
to another host because it's not my local computer. Now I
finally cannot withstand it and decided to fix them once and
for all.
Related to #2235.
This is done by:
1. Delaying the notification sending after the SSH key is commited in DB
2. Gracefully exit the mailer method if the record cannot be found