diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-10-07 18:00:48 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-10-07 18:00:48 +0300 |
commit | f42cfa9e8757161414f88e50d23b1d618bffad1f (patch) | |
tree | 8c379580d815a37e3090213974fed6969fb2927a /spec/support | |
parent | 12626f029dc4ab345f8afa1fd42a3c04723ec55e (diff) |
Refactor reference gathering to use a dedicated filter
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/filter_spec_helper.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/support/filter_spec_helper.rb b/spec/support/filter_spec_helper.rb index 56ce88abb48..97e5c270a59 100644 --- a/spec/support/filter_spec_helper.rb +++ b/spec/support/filter_spec_helper.rb @@ -29,12 +29,19 @@ module FilterSpecHelper # # Returns the Hash def pipeline_result(body, contexts = {}) - contexts.reverse_merge!(project: project) + contexts.reverse_merge!(project: project) if defined?(project) pipeline = HTML::Pipeline.new([described_class], contexts) pipeline.call(body) end + def reference_pipeline_result(body, contexts = {}) + contexts.reverse_merge!(project: project) if defined?(project) + + pipeline = HTML::Pipeline.new([described_class, Gitlab::Markdown::ReferenceGathererFilter], contexts) + pipeline.call(body) + end + # Modify a String reference to make it invalid # # Commit SHAs get reversed, IDs get incremented by 1, all other Strings get |