@@ -10,10 +10,10 @@ def setup
1010 end
1111
1212 def test_emojify
13- orig = "<p>:shipit :</p>"
13+ orig = "<p>:armenia :</p>"
1414 result = @emoji_filter . call ( orig , context : { asset_root : "https://foo.com" } )
1515
16- assert_match ( "https://foo.com/emoji/shipit .png" , result )
16+ assert_match ( "https://foo.com/emoji/unicode/1f1e6-1f1f2 .png" , result )
1717 end
1818
1919 def test_uri_encoding
@@ -58,46 +58,46 @@ def test_not_emojify_in_pre_tags
5858 end
5959
6060 def test_not_emojify_in_custom_single_tag_foo
61- body = "<foo>:shipit :</foo>"
61+ body = "<foo>:armenia :</foo>"
6262 result = @emoji_filter . call ( body , context : { asset_root : "https://foo.com" , ignored_ancestor_tags : [ "foo" ] } )
6363
6464 assert_equal ( body , result )
6565 end
6666
6767 def test_not_emojify_in_custom_multiple_tags_foo_and_bar
68- body = "<bar>:shipit :</bar>"
68+ body = "<bar>:armenia :</bar>"
6969 result = @emoji_filter . call ( body , context : { asset_root : "https://foo.com" , ignored_ancestor_tags : [ "foo" , "bar" ] } )
7070
7171 assert_equal ( body , result )
7272 end
7373
7474 def test_img_tag_attributes
75- body = "<p>:shipit :</p>"
75+ body = "<p>:armenia :</p>"
7676 result = @emoji_filter . call ( body , context : { asset_root : "https://foo.com" } )
7777
78- assert_match ( %(<img class="emoji" title=":shipit :" alt=":shipit :" src="https://foo.com/emoji/shipit .png" height="20" width="20" align="absmiddle">) , result )
78+ assert_match ( %(<img class="emoji" title=":armenia :" alt=":armenia :" src="https://foo.com/emoji/unicode/1f1e6-1f1f2 .png" height="20" width="20" align="absmiddle">) , result )
7979 end
8080
8181 def test_img_tag_attributes_can_be_customized
82- body = "<p>:shipit :</p>"
82+ body = "<p>:armenia :</p>"
8383 result = @emoji_filter . call ( body , context : { asset_root : "https://foo.com" , img_attrs : Hash ( "draggable" => "false" , "height" => nil , "width" => nil , "align" => nil ) } )
8484
85- assert_match ( %(<img class="emoji" title=":shipit :" alt=":shipit :" src="https://foo.com/emoji/shipit .png" draggable="false">) , result )
85+ assert_match ( %(<img class="emoji" title=":armenia :" alt=":armenia :" src="https://foo.com/emoji/unicode/1f1e6-1f1f2 .png" draggable="false">) , result )
8686 end
8787
8888 def test_img_attrs_value_can_accept_proclike_object
8989 remove_colons = -> ( name ) { name . delete ( ":" ) }
90- body = "<p>:shipit :</p>"
90+ body = "<p>:armenia :</p>"
9191 result = @emoji_filter . call ( body , context : { asset_root : "https://foo.com" , img_attrs : Hash ( "title" => remove_colons ) } )
9292
93- assert_match ( %(<img class="emoji" title="shipit " alt=":shipit :" src="https://foo.com/emoji/shipit .png" height="20" width="20" align="absmiddle">) , result )
93+ assert_match ( %(<img class="emoji" title="armenia " alt=":armenia :" src="https://foo.com/emoji/unicode/1f1e6-1f1f2 .png" height="20" width="20" align="absmiddle">) , result )
9494 end
9595
9696 def test_img_attrs_can_accept_symbolized_keys
97- body = "<p>:shipit :</p>"
97+ body = "<p>:armenia :</p>"
9898 result = @emoji_filter . call ( body , context : { asset_root : "https://foo.com" , img_attrs : Hash ( draggable : false , height : nil , width : nil , align : nil ) } )
9999
100- assert_match ( %(<img class="emoji" title=":shipit :" alt=":shipit :" src="https://foo.com/emoji/shipit .png" draggable="false">) , result )
100+ assert_match ( %(<img class="emoji" title=":armenia :" alt=":armenia :" src="https://foo.com/emoji/unicode/1f1e6-1f1f2 .png" draggable="false">) , result )
101101 end
102102
103103 def test_works_with_gemoji
0 commit comments