Commit 9433ae8f authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Include ancestor group labels in autocomplete

Fixes existing spec that wasn't testing what it was supposed to
parent 744c0166
...@@ -43,7 +43,7 @@ module Groups ...@@ -43,7 +43,7 @@ module Groups
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
def labels_as_hash(target) def labels_as_hash(target)
super(target, group_id: group.id, only_group_labels: true) super(target, group_id: group.id, only_group_labels: true, include_ancestor_groups: true)
end end
def commands(noteable) def commands(noteable)
......
---
title: Include ancestor group labels in autocomplete for epics
merge_request: 15460
author:
type: fixed
...@@ -21,7 +21,7 @@ describe Groups::AutocompleteService do ...@@ -21,7 +21,7 @@ describe Groups::AutocompleteService do
let!(:label1) { create(:group_label, group: group) } let!(:label1) { create(:group_label, group: group) }
let!(:label2) { create(:group_label, group: group) } let!(:label2) { create(:group_label, group: group) }
let!(:sub_group_label) { create(:group_label, group: sub_group) } let!(:sub_group_label) { create(:group_label, group: sub_group) }
let!(:parent_group_label) { create(:group_label, group: group.parent, group_id: group.id) } let!(:parent_group_label) { create(:group_label, group: group.parent) }
it 'returns labels from own group and ancestor groups' do it 'returns labels from own group and ancestor groups' do
results = subject.labels_as_hash(nil) results = subject.labels_as_hash(nil)
......
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