mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: More errors with non-ascii URLs
This commit is contained in:
@ -176,7 +176,23 @@ describe TopicEmbed do
|
||||
it 'img node doesn\'t have other class' do
|
||||
expect(response.body).to have_tag('img', without: { class: 'other' })
|
||||
end
|
||||
end
|
||||
|
||||
context "non-ascii URL" do
|
||||
let(:url) { 'http://eviltrout.com/test/ماهی' }
|
||||
let(:contents) { "<title>سلام</title><body>این یک پاراگراف آزمون است.</body>" }
|
||||
let!(:embeddable_host) { Fabricate(:embeddable_host) }
|
||||
let!(:file) { StringIO.new }
|
||||
|
||||
before do
|
||||
file.stubs(:read).returns contents
|
||||
TopicEmbed.stubs(:open).returns file
|
||||
end
|
||||
|
||||
it "doesn't throw an error" do
|
||||
response = TopicEmbed.find_remote(url)
|
||||
expect(response.title).to eq("سلام")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user