change all emoji image tests to use ?v=1

This commit is contained in:
Jeff Atwood 2015-12-22 14:36:21 -08:00
parent 95749fdeb7
commit e03861da7e
6 changed files with 10 additions and 10 deletions

View File

@ -244,7 +244,7 @@ HTML
end
it "should have an option to preserve emojis" do
emoji_image = "<img src='/images/emoji/emoji_one/heart.png?v=0' title=':heart:' class='emoji' alt='heart'>"
emoji_image = "<img src='/images/emoji/emoji_one/heart.png?v=1' title=':heart:' class='emoji' alt='heart'>"
expect(PrettyText.excerpt(emoji_image, 100, { keep_emojis: true })).to match_html(emoji_image)
end

View File

@ -49,7 +49,7 @@ Fabricator(:post_with_plenty_of_images, from: :post) do
<aside class="quote"><img src="/uploads/default/1/1234567890123456.jpg"></aside>
<div class="onebox-result"><img src="/uploads/default/1/1234567890123456.jpg"></div>
<div class="onebox"><img src="/uploads/default/1/1234567890123456.jpg"></div>
<p>With an emoji! <img src="//cdn.discourse.org/meta/images/emoji/twitter/smile.png?v=0" title=":smile:" class="emoji" alt="smile" width="72" height="72"></p>
<p>With an emoji! <img src="//cdn.discourse.org/meta/images/emoji/twitter/smile.png?v=1" title=":smile:" class="emoji" alt="smile" width="72" height="72"></p>
'
end

File diff suppressed because one or more lines are too long

View File

@ -559,7 +559,7 @@ export default {
"posts_count":3,
"reply_count":1,
"highest_post_number":3,
"image_url":"https://discourse-cdn.global.ssl.fastly.net/meta/images/emoji/twitter/smile.png?v=0",
"image_url":"https://discourse-cdn.global.ssl.fastly.net/meta/images/emoji/twitter/smile.png?v=1",
"created_at":"2014-10-07T13:37:19.628Z",
"last_posted_at":"2014-10-07T18:46:22.493Z",
"bumped":true,

View File

@ -10,14 +10,14 @@ test("Emoji.unescape", function(){
testUnescape("Not emoji :O) :frog) :smile)", "Not emoji :O) :frog) :smile)", "title without emoji");
testUnescape("Not emoji :frog :smile", "Not emoji :frog :smile", "end colon is not optional");
testUnescape("emoticons :)", "emoticons <img src='/images/emoji/emoji_one/slightly_smiling.png?v=0' title='slightly_smiling' alt='slightly_smiling' class='emoji'>", "emoticons are still supported");
testUnescape("emoticons :)", "emoticons <img src='/images/emoji/emoji_one/slightly_smiling.png?v=1' title='slightly_smiling' alt='slightly_smiling' class='emoji'>", "emoticons are still supported");
testUnescape("With emoji :O: :frog: :smile:",
"With emoji <img src='/images/emoji/emoji_one/o.png?v=0' title='O' alt='O' class='emoji'> <img src='/images/emoji/emoji_one/frog.png?v=0' title='frog' alt='frog' class='emoji'> <img src='/images/emoji/emoji_one/smile.png?v=0' title='smile' alt='smile' class='emoji'>",
"With emoji <img src='/images/emoji/emoji_one/o.png?v=1' title='O' alt='O' class='emoji'> <img src='/images/emoji/emoji_one/frog.png?v=1' title='frog' alt='frog' class='emoji'> <img src='/images/emoji/emoji_one/smile.png?v=1' title='smile' alt='smile' class='emoji'>",
"title with emoji");
testUnescape("a:smile:a", "a:smile:a", "word characters not allowed next to emoji");
testUnescape("(:frog:) :)", "(<img src='/images/emoji/emoji_one/frog.png?v=0' title='frog' alt='frog' class='emoji'>) <img src='/images/emoji/emoji_one/slightly_smiling.png?v=0' title='slightly_smiling' alt='slightly_smiling' class='emoji'>", "non-word characters allowed next to emoji");
testUnescape(":smile: hi", "<img src='/images/emoji/emoji_one/smile.png?v=0' title='smile' alt='smile' class='emoji'> hi", "start of line");
testUnescape("hi :smile:", "hi <img src='/images/emoji/emoji_one/smile.png?v=0' title='smile' alt='smile' class='emoji'>", "end of line");
testUnescape("(:frog:) :)", "(<img src='/images/emoji/emoji_one/frog.png?v=1' title='frog' alt='frog' class='emoji'>) <img src='/images/emoji/emoji_one/slightly_smiling.png?v=1' title='slightly_smiling' alt='slightly_smiling' class='emoji'>", "non-word characters allowed next to emoji");
testUnescape(":smile: hi", "<img src='/images/emoji/emoji_one/smile.png?v=1' title='smile' alt='smile' class='emoji'> hi", "start of line");
testUnescape("hi :smile:", "hi <img src='/images/emoji/emoji_one/smile.png?v=1' title='smile' alt='smile' class='emoji'>", "end of line");
});

View File

@ -76,6 +76,6 @@ test("recover", function() {
test('fancyTitle', function() {
var topic = Topic.create({ fancy_title: ":smile: with all :) the emojis :pear::peach:" });
equal(topic.get('fancyTitle'),
"<img src='/images/emoji/emoji_one/smile.png?v=0' title='smile' alt='smile' class='emoji'> with all <img src='/images/emoji/emoji_one/slightly_smiling.png?v=0' title='slightly_smiling' alt='slightly_smiling' class='emoji'> the emojis <img src='/images/emoji/emoji_one/pear.png?v=0' title='pear' alt='pear' class='emoji'><img src='/images/emoji/emoji_one/peach.png?v=0' title='peach' alt='peach' class='emoji'>",
"<img src='/images/emoji/emoji_one/smile.png?v=1' title='smile' alt='smile' class='emoji'> with all <img src='/images/emoji/emoji_one/slightly_smiling.png?v=1' title='slightly_smiling' alt='slightly_smiling' class='emoji'> the emojis <img src='/images/emoji/emoji_one/pear.png?v=1' title='pear' alt='pear' class='emoji'><img src='/images/emoji/emoji_one/peach.png?v=1' title='peach' alt='peach' class='emoji'>",
"supports emojis");
});