diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-09-22 18:36:39 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-04 23:49:42 +0300 |
commit | cd85c22faa7092edabf252fa157125ea571ed054 (patch) | |
tree | 975bb2503d17fa8b0f255225e6d915cd503cb3a7 /spec/models/concerns | |
parent | cd8e1b85b64ea9eb6a6a5b6de80e00ccc292c6ce (diff) |
Rename hierarchies to descendants where applicable
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/group_descendant_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/models/concerns/group_descendant_spec.rb b/spec/models/concerns/group_descendant_spec.rb index 87eee515cde..b1578fc593e 100644 --- a/spec/models/concerns/group_descendant_spec.rb +++ b/spec/models/concerns/group_descendant_spec.rb @@ -40,7 +40,7 @@ describe GroupDescendant, :nested_groups do end end - describe '.merge_hierarchies' do + describe '.build_hierarchy' do it 'combines hierarchies until the top' do other_subgroup = create(:group, parent: parent) other_subsub_group = create(:group, parent: subgroup) @@ -49,7 +49,7 @@ describe GroupDescendant, :nested_groups do expected_hierarchy = { parent => [other_subgroup, { subgroup => [subsub_group, other_subsub_group] }] } - expect(described_class.merge_hierarchies(groups)).to eq(expected_hierarchy) + expect(described_class.build_hierarchy(groups)).to eq(expected_hierarchy) end it 'combines upto a given parent' do @@ -60,7 +60,7 @@ describe GroupDescendant, :nested_groups do expected_hierarchy = [other_subgroup, { subgroup => [subsub_group, other_subsub_group] }] - expect(described_class.merge_hierarchies(groups, parent)).to eq(expected_hierarchy) + expect(described_class.build_hierarchy(groups, parent)).to eq(expected_hierarchy) end it 'handles building a tree out of order' do @@ -71,7 +71,7 @@ describe GroupDescendant, :nested_groups do groups = [subsub_group, other_subgroup2, other_subsub_group] expected_hierarchy = { parent => [{ subgroup => subsub_group }, other_subgroup2, { other_subgroup => other_subsub_group }] } - expect(described_class.merge_hierarchies(groups)).to eq(expected_hierarchy) + expect(described_class.build_hierarchy(groups)).to eq(expected_hierarchy) end end end @@ -113,7 +113,7 @@ describe GroupDescendant, :nested_groups do end end - describe '.merge_hierarchies' do + describe '.build_hierarchy' do it 'combines hierarchies until the top' do other_project = create(:project, namespace: parent) other_subgroup_project = create(:project, namespace: subgroup) @@ -122,7 +122,7 @@ describe GroupDescendant, :nested_groups do expected_hierarchy = { parent => [other_project, { subgroup => [subsub_group, other_subgroup_project] }] } - expect(described_class.merge_hierarchies(elements)).to eq(expected_hierarchy) + expect(described_class.build_hierarchy(elements)).to eq(expected_hierarchy) end it 'combines upto a given parent' do @@ -133,13 +133,13 @@ describe GroupDescendant, :nested_groups do expected_hierarchy = [other_project, { subgroup => [subsub_group, other_subgroup_project] }] - expect(described_class.merge_hierarchies(elements, parent)).to eq(expected_hierarchy) + expect(described_class.build_hierarchy(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) + expect(described_class.build_hierarchy([parent, subgroup])).to eq(expected_hierarchy) end it 'merges complex hierarchies' do @@ -164,7 +164,7 @@ describe GroupDescendant, :nested_groups do { other_subgroup => other_subproject } ] - actual_hierarchy = described_class.merge_hierarchies(projects, parent) + actual_hierarchy = described_class.build_hierarchy(projects, parent) expect(actual_hierarchy).to eq(expected_hierarchy) end |