DEV: add spec for tag with unicode name

This commit is contained in:
Arpit Jalan 2020-05-22 14:42:22 +05:30
parent f9d55b4941
commit 61d8955fcb
1 changed files with 12 additions and 1 deletions

View File

@ -128,7 +128,7 @@ RSpec.describe ListController do
let(:moderator) { Fabricate(:moderator) }
let(:admin) { Fabricate(:admin) }
let(:tag) { Fabricate(:tag) }
let(:private_message) { Fabricate(:private_message_topic) }
let(:private_message) { Fabricate(:private_message_topic, user: admin) }
before do
SiteSetting.tagging_enabled = true
@ -149,6 +149,17 @@ RSpec.describe ListController do
expect(response.status).to eq(200)
end
end
it 'should work for tag with unicode name' do
unicode_tag = Fabricate(:tag, name: 'hello-🇺🇸')
Fabricate(:topic_tag, tag: unicode_tag, topic: private_message)
sign_in(admin)
get "/topics/private-messages-tags/#{admin.username}/#{UrlHelper.encode_component(unicode_tag.name)}.json"
expect(response.status).to eq(200)
expect(response.parsed_body["topic_list"]["topics"].first["id"])
.to eq(private_message.id)
end
end
describe '#private_messages_group' do