Sha256: 6552effebd8c697ae0184419d80dd79ff3449b967cf606d4e52d9e953c4c56af
Contents?: true
Size: 1020 Bytes
Versions: 6
Compression:
Stored size: 1020 Bytes
Contents
require 'test_helper' require 'html/pipeline/gitlab' class HTML::Pipeline::GitLabEmojiFilterTest < Minitest::Test GitLabEmojiFilter = HTML::Pipeline::GitLab::GitLabEmojiFilter def test_emojify filter = GitLabEmojiFilter.new('<p>:heart:</p>', {asset_root: 'https://foo.com'}) doc = filter.call assert_match 'https://foo.com/emoji/heart.png', doc.search('img').attr('src').value end def test_unsupported_emoji block = '<p>:sheep:</p>' filter = GitLabEmojiFilter.new(block, {asset_root: 'https://foo.com'}) doc = filter.call assert_match block, doc.to_html end def test_uri_encoding filter = GitLabEmojiFilter.new('<p>:+1:</p>', {asset_root: 'https://foo.com'}) doc = filter.call assert_match 'https://foo.com/emoji/%2B1.png', doc.search('img').attr('src').value end def test_required_context_validation exception = assert_raises(ArgumentError) { GitLabEmojiFilter.call("", {}) } assert_match /:asset_root/, exception.message end end
Version data entries
6 entries across 6 versions & 1 rubygems