mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: More errors with non-ascii URLs
This commit is contained in:
parent
d1e587c10a
commit
dad57fa033
3 changed files with 21 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue