Commit 07432373 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'tc-geo-local-only-counts-matcher' into 'master'

Backport of "Geo: Ignore remote stored objects when calculating counts"

See merge request gitlab-org/gitlab-ce!17581
parents 195a2ac9 b0e5906d
RSpec::Matchers.define :match_ids do |*expected|
match do |actual|
actual_ids = map_ids(actual)
expected_ids = map_ids(expected)
expect(actual_ids).to match_array(expected_ids)
end
description do
'matches elements by ids'
end
def map_ids(elements)
elements = elements.flatten if elements.respond_to?(:flatten)
if elements.respond_to?(:map)
elements.map(&:id)
elsif elements.respond_to?(:id)
[elements.id]
else
raise ArgumentError, "could not map elements to ids: #{elements}"
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment