diff options
author | Vitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com> | 2017-11-07 06:32:32 +0300 |
---|---|---|
committer | Vitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com> | 2017-11-07 06:32:32 +0300 |
commit | c9659d4c1149fc35e60e64a2cdf3ce5acfa10739 (patch) | |
tree | cbe5302dd7a8c6de1b5841ab7175c3d51986873a /spec/lib/banzai/filter | |
parent | df7eaa85cb5fe9f2d2d42a226fc7f7bf8c19b775 (diff) |
Fix GFM reference links for closed milestones
Diffstat (limited to 'spec/lib/banzai/filter')
-rw-r--r-- | spec/lib/banzai/filter/milestone_reference_filter_spec.rb | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/spec/lib/banzai/filter/milestone_reference_filter_spec.rb b/spec/lib/banzai/filter/milestone_reference_filter_spec.rb index 84578668133..6a9087d2e59 100644 --- a/spec/lib/banzai/filter/milestone_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/milestone_reference_filter_spec.rb @@ -294,8 +294,7 @@ describe Banzai::Filter::MilestoneReferenceFilter do end end - context 'project milestones' do - let(:milestone) { create(:milestone, project: project) } + shared_context 'project milestones' do let(:reference) { milestone.to_reference(format: :iid) } include_examples 'reference parsing' @@ -309,8 +308,7 @@ describe Banzai::Filter::MilestoneReferenceFilter do it_behaves_like 'cross project shorthand reference' end - context 'group milestones' do - let(:milestone) { create(:milestone, group: group) } + shared_context 'group milestones' do let(:reference) { milestone.to_reference(format: :name) } include_examples 'reference parsing' @@ -354,4 +352,32 @@ describe Banzai::Filter::MilestoneReferenceFilter do expect(result.css('a').first.attr('href')).to eq(urls.milestone_url(milestone)) end end + + context 'when milestone is open' do + context 'project milestones' do + let(:milestone) { create(:milestone, project: project) } + + include_context 'project milestones' + end + + context 'group milestones' do + let(:milestone) { create(:milestone, group: group) } + + include_context 'group milestones' + end + end + + context 'when milestone is closed' do + context 'project milestones' do + let(:milestone) { create(:milestone, :closed, project: project) } + + include_context 'project milestones' + end + + context 'group milestones' do + let(:milestone) { create(:milestone, :closed, group: group) } + + include_context 'group milestones' + end + end end |