Fix deprecation in specs

From https://github.com/gitlabhq/gitlabhq/pull/6053
Merge pull request #6061 from zzet/patch-8

Fix deprecation in specs