summaryrefslogtreecommitdiff
path: root/spec/models/concerns
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-09-10 17:20:27 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-04 22:49:41 +0200
commitbb5187bb2a71f87b3ff49388f70dbcb27dfe4c6a (patch)
tree3049fc8a014ea93fdee87d1cb3ac9eefd8ea88c6 /spec/models/concerns
parent8f6dac4991ba7f5771a24175784f19dc1bbd4103 (diff)
downloadgitlab-ce-bb5187bb2a71f87b3ff49388f70dbcb27dfe4c6a.tar.gz
Handle case where 2 matches in the same tree are found
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/group_hierarchy_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/concerns/group_hierarchy_spec.rb b/spec/models/concerns/group_hierarchy_spec.rb
index 1f4fab88781..bb02983c776 100644
--- a/spec/models/concerns/group_hierarchy_spec.rb
+++ b/spec/models/concerns/group_hierarchy_spec.rb
@@ -124,6 +124,12 @@ describe GroupHierarchy, :nested_groups do
expect(described_class.merge_hierarchies(elements, parent)).to eq(expected_hierarchy)
end
+
+ it 'merges to elements in the same hierarchy' do
+ expected_hierarchy = { parent => subgroup }
+
+ expect(described_class.merge_hierarchies([parent, subgroup])).to eq(expected_hierarchy)
+ end
end
end
end