diff options
author | Mario de la Ossa <mariodelaossa@gmail.com> | 2018-06-12 14:35:45 -0600 |
---|---|---|
committer | Mario de la Ossa <mariodelaossa@gmail.com> | 2018-06-12 16:28:47 -0600 |
commit | 7530e4ec86a686dede8eb8535fd231c1a75d3659 (patch) | |
tree | 00078c80069a56d67213a44cb59379dc12aed0de /spec | |
parent | 10a190dba2db339093cdc4949ef54cc287196b9b (diff) | |
download | gitlab-ce-7530e4ec86a686dede8eb8535fd231c1a75d3659.tar.gz |
Fix Banzai reference for milestones belonging to parent groups
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/banzai/filter/milestone_reference_filter_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/lib/banzai/filter/milestone_reference_filter_spec.rb b/spec/lib/banzai/filter/milestone_reference_filter_spec.rb index f8fa9b2d13d..91d4a60ba95 100644 --- a/spec/lib/banzai/filter/milestone_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/milestone_reference_filter_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' describe Banzai::Filter::MilestoneReferenceFilter do include FilterSpecHelper - let(:group) { create(:group, :public) } + let(:parent_group) { create(:group, :public) } + let(:group) { create(:group, :public, parent: parent_group) } let(:project) { create(:project, :public, group: group) } it 'requires project context' do @@ -340,6 +341,13 @@ describe Banzai::Filter::MilestoneReferenceFilter do expect(doc.css('a')).to be_empty end + + it 'supports parent group references', :nested_groups do + milestone.update!(group: parent_group) + + doc = reference_filter("See #{reference}") + expect(doc.css('a').first.text).to eq(milestone.name) + end end context 'group context' do |