9
9
class HTMLPipelineTest < Minitest ::Test
10
10
def setup
11
11
@default_context = { }
12
- @pipeline = HTMLPipeline . new ( text_filters : [ TestTextFilter . new ] , default_context : @default_context )
12
+ @pipeline = HTMLPipeline . new ( text_filters : [ TestReverseFilter . new ] , default_context : @default_context )
13
13
end
14
14
15
15
def test_filter_instrumentation
@@ -22,7 +22,7 @@ def test_filter_instrumentation
22
22
23
23
assert ( event , "event expected" )
24
24
assert_equal ( "call_filter.html_pipeline" , event )
25
- assert_equal ( TestTextFilter . name , payload [ :filter ] )
25
+ assert_equal ( TestReverseFilter . name , payload [ :filter ] )
26
26
assert_equal ( @pipeline . class . name , payload [ :pipeline ] )
27
27
assert_equal ( body . reverse , payload [ :result ] [ :output ] )
28
28
end
@@ -89,7 +89,7 @@ def test_incorrect_convert_filter
89
89
def test_convert_filter_needed_for_text_and_html_filters
90
90
assert_raises ( HTMLPipeline ::InvalidFilterError ) do
91
91
HTMLPipeline . new (
92
- text_filters : [ TestTextFilter . new ] ,
92
+ text_filters : [ TestReverseFilter . new ] ,
93
93
node_filters : [
94
94
HTMLPipeline ::NodeFilter ::MentionFilter . new ,
95
95
] ,
@@ -103,4 +103,17 @@ def test_incorrect_node_filters
103
103
HTMLPipeline . new ( node_filters : [ HTMLPipeline ::ConvertFilter ::MarkdownFilter ] , default_context : @default_context )
104
104
end
105
105
end
106
+
107
+ def test_kitchen_sink
108
+ text = "Hey there, @billy. Love to see <marquee>yah</marquee>!"
109
+
110
+ pipeline = HTMLPipeline . new (
111
+ text_filters : [ TestReverseFilter . new , YehBolderFilter . new ] ,
112
+ convert_filter : HTMLPipeline ::ConvertFilter ::MarkdownFilter . new ,
113
+ node_filters : [ HTMLPipeline ::NodeFilter ::MentionFilter . new ] ,
114
+ )
115
+ result = pipeline . call ( text ) [ :output ]
116
+
117
+ assert_equal ( "<p>!>eeuqram/eeuqram< ees ot evoL .yllib@ ,ereht <strong>yeH</strong></p>" , result )
118
+ end
106
119
end
0 commit comments