It backports spec/support/matchers/match_ids.rb from gitlab-org/gitlab-ee!4864.
spec/support/matchers/match_ids.rb
#4215 (closed)